diff options
Diffstat (limited to 'tools/perf/bench')
-rw-r--r-- | tools/perf/bench/Build | 1 | ||||
-rw-r--r-- | tools/perf/bench/futex.h | 13 | ||||
-rw-r--r-- | tools/perf/bench/mem-memcpy-x86-64-lib.c | 24 | ||||
-rw-r--r-- | tools/perf/bench/numa.c | 3 |
4 files changed, 15 insertions, 26 deletions
diff --git a/tools/perf/bench/Build b/tools/perf/bench/Build index 768e408757a0..5352303518e1 100644 --- a/tools/perf/bench/Build +++ b/tools/perf/bench/Build @@ -11,7 +11,6 @@ perf-y += epoll-ctl.o perf-y += synthesize.o perf-y += kallsyms-parse.o -perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-lib.o perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h index 31b53cc7d5bc..33f3f3230ae1 100644 --- a/tools/perf/bench/futex.h +++ b/tools/perf/bench/futex.h @@ -14,6 +14,19 @@ #include <linux/futex.h> /** + * SYS_futex is expected from system C library, + * in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex) + * some newer 32bit architectures e.g. RISCV32 is using 64bit time_t from + * get go unlike other 32bit architectures in glibc, therefore it wont have + * NR_futex defined but just NR_futex_time64 this aliases it to NR_futex + * so that SYS_futex is then defined for rv32 +*/ + +#if !defined(SYS_futex) && defined(SYS_futex_time64) +#define SYS_futex SYS_futex_time64 +#endif + +/** * futex() - SYS_futex syscall wrapper * @uaddr: address of first futex * @op: futex op code diff --git a/tools/perf/bench/mem-memcpy-x86-64-lib.c b/tools/perf/bench/mem-memcpy-x86-64-lib.c deleted file mode 100644 index 4130734dde84..000000000000 --- a/tools/perf/bench/mem-memcpy-x86-64-lib.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * From code in arch/x86/lib/usercopy_64.c, copied to keep tools/ copy - * of the kernel's arch/x86/lib/memcpy_64.s used in 'perf bench mem memcpy' - * happy. - */ -#include <linux/types.h> - -unsigned long __memcpy_mcsafe(void *dst, const void *src, size_t cnt); -unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len); - -unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len) -{ - for (; len; --len, to++, from++) { - /* - * Call the assembly routine back directly since - * memcpy_mcsafe() may silently fallback to memcpy. - */ - unsigned long rem = __memcpy_mcsafe(to, from, 1); - - if (rem) - break; - } - return len; -} diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index 5797253b9700..1aa2bad26fc7 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -24,6 +24,7 @@ #include <string.h> #include <unistd.h> #include <sys/mman.h> +#include <inttypes.h> #include <sys/time.h> #include <sys/resource.h> #include <sys/wait.h> @@ -1193,7 +1194,7 @@ static void *worker_thread(void *__tdata) /* Check whether our max runtime timed out: */ if (g->p.nr_secs) { timersub(&stop, &start0, &diff); - if ((u32)diff.tv_sec >= g->p.nr_secs) { + if ((u32)diff.tv_sec >= (long int)g->p.nr_secs) { g->stop_work = true; break; } |