diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-22 17:37:02 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-22 20:41:57 -0500 |
commit | 9486aa38771661e96fbb51c549b9901b5df609d8 (patch) | |
tree | 72cecbff0cb5124c960feeec3a6ac1fff75c649a /tools/perf/builtin-sched.c | |
parent | 57b84e53171ce672683faf1cab2e660965a6bdaf (diff) |
perf tools: Fix 64 bit integer format strings
Using %L[uxd] has issues in some architectures, like on ppc64. Fix it
by making our 64 bit integers typedefs of stdint.h types and using
PRI[ux]64 like, for instance, git does.
Reported by Denis Kirjanov that provided a patch for one case, I went
and changed all cases.
Reported-by: Denis Kirjanov <dkirjanov@kernel.org>
Tested-by: Denis Kirjanov <dkirjanov@kernel.org>
LKML-Reference: <20110120093246.GA8031@hera.kernel.org>
Cc: Denis Kirjanov <dkirjanov@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Pingtian Han <phan@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r-- | tools/perf/builtin-sched.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 29e7ffd85690..29acb894e035 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -193,7 +193,7 @@ static void calibrate_run_measurement_overhead(void) | |||
193 | } | 193 | } |
194 | run_measurement_overhead = min_delta; | 194 | run_measurement_overhead = min_delta; |
195 | 195 | ||
196 | printf("run measurement overhead: %Ld nsecs\n", min_delta); | 196 | printf("run measurement overhead: %" PRIu64 " nsecs\n", min_delta); |
197 | } | 197 | } |
198 | 198 | ||
199 | static void calibrate_sleep_measurement_overhead(void) | 199 | static void calibrate_sleep_measurement_overhead(void) |
@@ -211,7 +211,7 @@ static void calibrate_sleep_measurement_overhead(void) | |||
211 | min_delta -= 10000; | 211 | min_delta -= 10000; |
212 | sleep_measurement_overhead = min_delta; | 212 | sleep_measurement_overhead = min_delta; |
213 | 213 | ||
214 | printf("sleep measurement overhead: %Ld nsecs\n", min_delta); | 214 | printf("sleep measurement overhead: %" PRIu64 " nsecs\n", min_delta); |
215 | } | 215 | } |
216 | 216 | ||
217 | static struct sched_atom * | 217 | static struct sched_atom * |
@@ -617,13 +617,13 @@ static void test_calibrations(void) | |||
617 | burn_nsecs(1e6); | 617 | burn_nsecs(1e6); |
618 | T1 = get_nsecs(); | 618 | T1 = get_nsecs(); |
619 | 619 | ||
620 | printf("the run test took %Ld nsecs\n", T1-T0); | 620 | printf("the run test took %" PRIu64 " nsecs\n", T1 - T0); |
621 | 621 | ||
622 | T0 = get_nsecs(); | 622 | T0 = get_nsecs(); |
623 | sleep_nsecs(1e6); | 623 | sleep_nsecs(1e6); |
624 | T1 = get_nsecs(); | 624 | T1 = get_nsecs(); |
625 | 625 | ||
626 | printf("the sleep test took %Ld nsecs\n", T1-T0); | 626 | printf("the sleep test took %" PRIu64 " nsecs\n", T1 - T0); |
627 | } | 627 | } |
628 | 628 | ||
629 | #define FILL_FIELD(ptr, field, event, data) \ | 629 | #define FILL_FIELD(ptr, field, event, data) \ |
@@ -816,10 +816,10 @@ replay_switch_event(struct trace_switch_event *switch_event, | |||
816 | delta = 0; | 816 | delta = 0; |
817 | 817 | ||
818 | if (delta < 0) | 818 | if (delta < 0) |
819 | die("hm, delta: %Ld < 0 ?\n", delta); | 819 | die("hm, delta: %" PRIu64 " < 0 ?\n", delta); |
820 | 820 | ||
821 | if (verbose) { | 821 | if (verbose) { |
822 | printf(" ... switch from %s/%d to %s/%d [ran %Ld nsecs]\n", | 822 | printf(" ... switch from %s/%d to %s/%d [ran %" PRIu64 " nsecs]\n", |
823 | switch_event->prev_comm, switch_event->prev_pid, | 823 | switch_event->prev_comm, switch_event->prev_pid, |
824 | switch_event->next_comm, switch_event->next_pid, | 824 | switch_event->next_comm, switch_event->next_pid, |
825 | delta); | 825 | delta); |
@@ -1048,7 +1048,7 @@ latency_switch_event(struct trace_switch_event *switch_event, | |||
1048 | delta = 0; | 1048 | delta = 0; |
1049 | 1049 | ||
1050 | if (delta < 0) | 1050 | if (delta < 0) |
1051 | die("hm, delta: %Ld < 0 ?\n", delta); | 1051 | die("hm, delta: %" PRIu64 " < 0 ?\n", delta); |
1052 | 1052 | ||
1053 | 1053 | ||
1054 | sched_out = perf_session__findnew(session, switch_event->prev_pid); | 1054 | sched_out = perf_session__findnew(session, switch_event->prev_pid); |
@@ -1221,7 +1221,7 @@ static void output_lat_thread(struct work_atoms *work_list) | |||
1221 | 1221 | ||
1222 | avg = work_list->total_lat / work_list->nb_atoms; | 1222 | avg = work_list->total_lat / work_list->nb_atoms; |
1223 | 1223 | ||
1224 | printf("|%11.3f ms |%9llu | avg:%9.3f ms | max:%9.3f ms | max at: %9.6f s\n", | 1224 | printf("|%11.3f ms |%9" PRIu64 " | avg:%9.3f ms | max:%9.3f ms | max at: %9.6f s\n", |
1225 | (double)work_list->total_runtime / 1e6, | 1225 | (double)work_list->total_runtime / 1e6, |
1226 | work_list->nb_atoms, (double)avg / 1e6, | 1226 | work_list->nb_atoms, (double)avg / 1e6, |
1227 | (double)work_list->max_lat / 1e6, | 1227 | (double)work_list->max_lat / 1e6, |
@@ -1423,7 +1423,7 @@ map_switch_event(struct trace_switch_event *switch_event, | |||
1423 | delta = 0; | 1423 | delta = 0; |
1424 | 1424 | ||
1425 | if (delta < 0) | 1425 | if (delta < 0) |
1426 | die("hm, delta: %Ld < 0 ?\n", delta); | 1426 | die("hm, delta: %" PRIu64 " < 0 ?\n", delta); |
1427 | 1427 | ||
1428 | 1428 | ||
1429 | sched_out = perf_session__findnew(session, switch_event->prev_pid); | 1429 | sched_out = perf_session__findnew(session, switch_event->prev_pid); |
@@ -1713,7 +1713,7 @@ static void __cmd_lat(void) | |||
1713 | } | 1713 | } |
1714 | 1714 | ||
1715 | printf(" -----------------------------------------------------------------------------------------\n"); | 1715 | printf(" -----------------------------------------------------------------------------------------\n"); |
1716 | printf(" TOTAL: |%11.3f ms |%9Ld |\n", | 1716 | printf(" TOTAL: |%11.3f ms |%9" PRIu64 " |\n", |
1717 | (double)all_runtime/1e6, all_count); | 1717 | (double)all_runtime/1e6, all_count); |
1718 | 1718 | ||
1719 | printf(" ---------------------------------------------------\n"); | 1719 | printf(" ---------------------------------------------------\n"); |