aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/bench/syscall.c
diff options
context:
space:
mode:
authorPierre Gondois <[email protected]>2021-02-24 18:24:10 +0000
committerArnaldo Carvalho de Melo <[email protected]>2021-03-06 19:54:24 +0000
commitded2e511a8af9f14482b11225f73db63231fc7a4 (patch)
treef4dfa6e1c814957d4076805abd8d9b347b232b47 /tools/perf/bench/syscall.c
parenttools headers UAPI: Sync kvm.h headers with the kernel sources (diff)
downloadkernel-ded2e511a8af9f14482b11225f73db63231fc7a4.tar.gz
kernel-ded2e511a8af9f14482b11225f73db63231fc7a4.zip
perf tools: Cast (struct timeval).tv_sec when printing
The musl-libc [1] defines (struct timeval).tv_sec as a 'long long' for arm and other architectures. The default build having a '-Wformat' flag, not casting the field when printing prevents from building perf. This patch casts the (struct timeval).tv_sec fields to the expected format. [1] git://git.musl-libc.org/musl Signed-off-by: Pierre Gondois <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: [email protected] Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/bench/syscall.c')
-rw-r--r--tools/perf/bench/syscall.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/bench/syscall.c b/tools/perf/bench/syscall.c
index 5fe621cff8e9..9b751016f4b6 100644
--- a/tools/perf/bench/syscall.c
+++ b/tools/perf/bench/syscall.c
@@ -54,7 +54,7 @@ int bench_syscall_basic(int argc, const char **argv)
result_usec += diff.tv_usec;
printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
- diff.tv_sec,
+ (unsigned long) diff.tv_sec,
(unsigned long) (diff.tv_usec/1000));
printf(" %14lf usecs/op\n",
@@ -66,7 +66,7 @@ int bench_syscall_basic(int argc, const char **argv)
case BENCH_FORMAT_SIMPLE:
printf("%lu.%03lu\n",
- diff.tv_sec,
+ (unsigned long) diff.tv_sec,
(unsigned long) (diff.tv_usec / 1000));
break;