All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: Fix build failure on 32-bit arch
@ 2015-06-11 12:44 He Kuang
  2015-06-11 14:14 ` Arnaldo Carvalho de Melo
  2015-06-12  8:51 ` [tip:perf/core] " tip-bot for He Kuang
  0 siblings, 2 replies; 3+ messages in thread
From: He Kuang @ 2015-06-11 12:44 UTC (permalink / raw)
  To: a.p.zijlstra, mingo, acme, jolsa, kan.liang; +Cc: wangnan0, linux-kernel

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>
---
 tools/perf/builtin-report.c | 2 +-
 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 628090b..32626ea 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,
 {
 	struct perf_evsel *pos;
 
-	fprintf(stdout, "#\n# Total Lost Samples: %lu\n#\n", evlist->stats.total_lost_samples);
+	fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", evlist->stats.total_lost_samples);
 	evlist__for_each(evlist, pos) {
 		struct hists *hists = evsel__hists(pos);
 		const char *evname = perf_evsel__name(pos);
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 88d87bf..f31e024 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)
 		drop_rate = (double)stats->total_lost_samples /
 			    (double) (stats->nr_events[PERF_RECORD_SAMPLE] + stats->total_lost_samples);
 		if (drop_rate > 0.05) {
-			ui__warning("Processed %lu samples and lost %3.2f%% samples!\n\n",
+			ui__warning("Processed %" PRIu64 " samples and lost %3.2f%% samples!\n\n",
 				    stats->nr_events[PERF_RECORD_SAMPLE] + stats->total_lost_samples,
 				    drop_rate * 100.0);
 		}
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf tools: Fix build failure on 32-bit arch
  2015-06-11 12:44 [PATCH] perf tools: Fix build failure on 32-bit arch He Kuang
@ 2015-06-11 14:14 ` Arnaldo Carvalho de Melo
  2015-06-12  8:51 ` [tip:perf/core] " tip-bot for He Kuang
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-06-11 14:14 UTC (permalink / raw)
  To: He Kuang; +Cc: a.p.zijlstra, mingo, jolsa, kan.liang, wangnan0, linux-kernel

Em Thu, Jun 11, 2015 at 12:44:24PM +0000, He Kuang escreveu:
> 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.

Thanks, applied.

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf tools: Fix build failure on 32-bit arch
  2015-06-11 12:44 [PATCH] perf tools: Fix build failure on 32-bit arch He Kuang
  2015-06-11 14:14 ` Arnaldo Carvalho de Melo
@ 2015-06-12  8:51 ` tip-bot for He Kuang
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for He Kuang @ 2015-06-12  8:51 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, tglx, linux-kernel, hekuang, kan.liang, hpa, acme,
	wangnan0, jolsa, a.p.zijlstra

Commit-ID:  6ba29c2fa5adcc33b201faec99057b6a72bd5029
Gitweb:     http://git.kernel.org/tip/6ba29c2fa5adcc33b201faec99057b6a72bd5029
Author:     He Kuang <hekuang@huawei.com>
AuthorDate: Thu, 11 Jun 2015 12:44:24 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 11 Jun 2015 11:14:21 -0300

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>
---
 tools/perf/builtin-report.c | 2 +-
 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 628090b..32626ea 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,
 {
 	struct perf_evsel *pos;
 
-	fprintf(stdout, "#\n# Total Lost Samples: %lu\n#\n", evlist->stats.total_lost_samples);
+	fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", evlist->stats.total_lost_samples);
 	evlist__for_each(evlist, pos) {
 		struct hists *hists = evsel__hists(pos);
 		const char *evname = perf_evsel__name(pos);
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 88d87bf..f31e024 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)
 		drop_rate = (double)stats->total_lost_samples /
 			    (double) (stats->nr_events[PERF_RECORD_SAMPLE] + stats->total_lost_samples);
 		if (drop_rate > 0.05) {
-			ui__warning("Processed %lu samples and lost %3.2f%% samples!\n\n",
+			ui__warning("Processed %" PRIu64 " samples and lost %3.2f%% samples!\n\n",
 				    stats->nr_events[PERF_RECORD_SAMPLE] + stats->total_lost_samples,
 				    drop_rate * 100.0);
 		}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-12  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-11 12:44 [PATCH] perf tools: Fix build failure on 32-bit arch He Kuang
2015-06-11 14:14 ` Arnaldo Carvalho de Melo
2015-06-12  8:51 ` [tip:perf/core] " tip-bot for He Kuang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.