Commit 2cd9046c authored by David Miller's avatar David Miller Committed by Ingo Molnar

perf sched: Fix build failure on sparc

Here, tvec->tv_usec is "unsigned int" not "unsigned long".

Since the type is different on every platform, it's probably
best to just use long printf formats and cast.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091213.235622.53363059.davem@davemloft.net>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2044279d
...@@ -320,10 +320,12 @@ int bench_sched_messaging(int argc, const char **argv, ...@@ -320,10 +320,12 @@ int bench_sched_messaging(int argc, const char **argv,
num_groups, num_groups * 2 * num_fds, num_groups, num_groups * 2 * num_fds,
thread_mode ? "threads" : "processes"); thread_mode ? "threads" : "processes");
printf(" %14s: %lu.%03lu [sec]\n", "Total time", printf(" %14s: %lu.%03lu [sec]\n", "Total time",
diff.tv_sec, diff.tv_usec/1000); diff.tv_sec,
(unsigned long) (diff.tv_usec/1000));
break; break;
case BENCH_FORMAT_SIMPLE: case BENCH_FORMAT_SIMPLE:
printf("%lu.%03lu\n", diff.tv_sec, diff.tv_usec/1000); printf("%lu.%03lu\n", diff.tv_sec,
(unsigned long) (diff.tv_usec/1000));
break; break;
default: default:
/* reaching here is something disaster */ /* reaching here is something disaster */
......
...@@ -100,7 +100,8 @@ int bench_sched_pipe(int argc, const char **argv, ...@@ -100,7 +100,8 @@ int bench_sched_pipe(int argc, const char **argv,
result_usec += diff.tv_usec; result_usec += diff.tv_usec;
printf(" %14s: %lu.%03lu [sec]\n\n", "Total time", printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
diff.tv_sec, diff.tv_usec/1000); diff.tv_sec,
(unsigned long) (diff.tv_usec/1000));
printf(" %14lf usecs/op\n", printf(" %14lf usecs/op\n",
(double)result_usec / (double)loops); (double)result_usec / (double)loops);
...@@ -111,7 +112,8 @@ int bench_sched_pipe(int argc, const char **argv, ...@@ -111,7 +112,8 @@ int bench_sched_pipe(int argc, const char **argv,
case BENCH_FORMAT_SIMPLE: case BENCH_FORMAT_SIMPLE:
printf("%lu.%03lu\n", printf("%lu.%03lu\n",
diff.tv_sec, diff.tv_usec / 1000); diff.tv_sec,
(unsigned long) (diff.tv_usec / 1000));
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment