]> git.baikalelectronics.ru Git - kernel.git/commitdiff
perf sched: Fix build failure on sparc
authorDavid Miller <davem@davemloft.net>
Mon, 14 Dec 2009 07:56:22 +0000 (23:56 -0800)
committerIngo Molnar <mingo@elte.hu>
Mon, 14 Dec 2009 07:59:12 +0000 (08:59 +0100)
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: David 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: Ingo Molnar <mingo@elte.hu>
tools/perf/bench/sched-messaging.c
tools/perf/bench/sched-pipe.c

index e249eb22b43bd0409c6179d4904951b2e1740065..81cee78181fa28fd2f382144c061e409c439fb3f 100644 (file)
@@ -320,10 +320,12 @@ int bench_sched_messaging(int argc, const char **argv,
                       num_groups, num_groups * 2 * num_fds,
                       thread_mode ? "threads" : "processes");
                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;
        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;
        default:
                /* reaching here is something disaster */
index 2354f3830b1e264c6f85e9a4e96305b5fd0618ee..4f77c7c27640791e357a130d71639d688c892641 100644 (file)
@@ -100,7 +100,8 @@ int bench_sched_pipe(int argc, const char **argv,
                result_usec += diff.tv_usec;
 
                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",
                       (double)result_usec / (double)loops);
@@ -111,7 +112,8 @@ int bench_sched_pipe(int argc, const char **argv,
 
        case BENCH_FORMAT_SIMPLE:
                printf("%lu.%03lu\n",
-                      diff.tv_sec, diff.tv_usec / 1000);
+                      diff.tv_sec,
+                      (unsigned long) (diff.tv_usec / 1000));
                break;
 
        default: