diff options
author | He Kuang <hekuang@huawei.com> | 2015-06-11 08:44:24 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-06-11 10:14:21 -0400 |
commit | 6ba29c2fa5adcc33b201faec99057b6a72bd5029 (patch) | |
tree | 64db3a4b3de36acc1469bf507d3eb7eb78664c95 /tools | |
parent | cb5ef60067c11cc8887122f6f168c21941c5d624 (diff) |
perf tools: Fix build failure on 32-bit arch
Failed in 32bit arch build like this:
CC /opt/h00206996/output/perf/arm32/builtin-record.o
util/session.c: In function ‘perf_session__warn_about_errors’:
util/session.c:1304:9: error: format ‘%lu’ expects argument of type ‘long unsigned int’,
but argument 2 has type ‘long long unsigned int’ [-Werror=format=]
builtin-report.c: In function ‘perf_evlist__tty_browse_hists’:
builtin-report.c:323:2: error: format ‘%lu’ expects argument of type ‘long unsigned int’,
but argument 3 has type ‘u64’ [-Werror=format=]
Replace %lu format strings in warning message with PRIu64 for u64
'total_lost_samples' to fix this problem.
Signed-off-by: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1434026664-71642-1-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-report.c | 2 | ||||
-rw-r--r-- | tools/perf/util/session.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 628090b478ab..32626ea3e227 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -320,7 +320,7 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist, | |||
320 | { | 320 | { |
321 | struct perf_evsel *pos; | 321 | struct perf_evsel *pos; |
322 | 322 | ||
323 | fprintf(stdout, "#\n# Total Lost Samples: %lu\n#\n", evlist->stats.total_lost_samples); | 323 | fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", evlist->stats.total_lost_samples); |
324 | evlist__for_each(evlist, pos) { | 324 | evlist__for_each(evlist, pos) { |
325 | struct hists *hists = evsel__hists(pos); | 325 | struct hists *hists = evsel__hists(pos); |
326 | const char *evname = perf_evsel__name(pos); | 326 | const char *evname = perf_evsel__name(pos); |
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 88d87bf3049f..f31e024ddf7d 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -1299,7 +1299,7 @@ static void perf_session__warn_about_errors(const struct perf_session *session) | |||
1299 | drop_rate = (double)stats->total_lost_samples / | 1299 | drop_rate = (double)stats->total_lost_samples / |
1300 | (double) (stats->nr_events[PERF_RECORD_SAMPLE] + stats->total_lost_samples); | 1300 | (double) (stats->nr_events[PERF_RECORD_SAMPLE] + stats->total_lost_samples); |
1301 | if (drop_rate > 0.05) { | 1301 | if (drop_rate > 0.05) { |
1302 | ui__warning("Processed %lu samples and lost %3.2f%% samples!\n\n", | 1302 | ui__warning("Processed %" PRIu64 " samples and lost %3.2f%% samples!\n\n", |
1303 | stats->nr_events[PERF_RECORD_SAMPLE] + stats->total_lost_samples, | 1303 | stats->nr_events[PERF_RECORD_SAMPLE] + stats->total_lost_samples, |
1304 | drop_rate * 100.0); | 1304 | drop_rate * 100.0); |
1305 | } | 1305 | } |