All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] perf hists: change print format from lu to PRIu64
@ 2014-12-02 17:37 Tom Huynh
  2014-12-12  8:16 ` [tip:perf/urgent] perf hists browser: Change print format from %lu to %PRIu64 tip-bot for Tom Huynh
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Huynh @ 2014-12-02 17:37 UTC (permalink / raw)
  To: mingo, acme, namhyung, jolsa
  Cc: a.p.zijlstra, paulus, kim.phillips, linux-kernel, mmullins,
	Tom Huynh

nr_events in tools/perf/ui/browsers/hists.c is of type u64, so the print
format (%lu) causes perf report to show 0 event count when running with 
32-bit userspace without redirection. This patch fixes that problem by
printing nr_events as PRIu64. 

Signed-off-by: Tom Huynh <tom.huynh@freescale.com>
---
change since v1: replace %llu with PRIu64

 tools/perf/ui/browsers/hists.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index cfb976b..c6d68b8 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1254,7 +1254,7 @@ static int hists__browser_title(struct hists *hists,
 
 	nr_samples = convert_unit(nr_samples, &unit);
 	printed = scnprintf(bf, size,
-			   "Samples: %lu%c of event '%s', Event count (approx.): %lu",
+			   "Samples: %lu%c of event '%s', Event count (approx.): %" PRIu64,
 			   nr_samples, unit, ev_name, nr_events);
 
 
-- 
1.9.1


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

* [tip:perf/urgent] perf hists browser: Change print format from %lu to %PRIu64
  2014-12-02 17:37 [PATCHv2] perf hists: change print format from lu to PRIu64 Tom Huynh
@ 2014-12-12  8:16 ` tip-bot for Tom Huynh
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Tom Huynh @ 2014-12-12  8:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jolsa, mingo, acme, tom.huynh, linux-kernel, namhyung, mingo,
	a.p.zijlstra, kim.phillips, paulus, hpa, tglx, mmullins

Commit-ID:  e641f696ebe4514efac00d1f4a485a06c8e94eea
Gitweb:     http://git.kernel.org/tip/e641f696ebe4514efac00d1f4a485a06c8e94eea
Author:     Tom Huynh <tom.huynh@freescale.com>
AuthorDate: Tue, 2 Dec 2014 11:37:22 -0600
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 9 Dec 2014 09:14:32 -0300

perf hists browser: Change print format from %lu to %PRIu64

The nr_events variable in tools/perf/ui/browsers/hists.c is of type u64,
so the print format (%lu) causes 'perf report' to show 0 event count
when running with 32-bit userspace without redirection.

This patch fixes that problem by printing nr_events as PRIu64.

Signed-off-by: Tom Huynh <tom.huynh@freescale.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Matt Mullins <mmullins@mmlx.us>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1417541842-9747-1-git-send-email-tom.huynh@freescale.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 502daff..e6bb04b 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1252,7 +1252,7 @@ static int hists__browser_title(struct hists *hists,
 
 	nr_samples = convert_unit(nr_samples, &unit);
 	printed = scnprintf(bf, size,
-			   "Samples: %lu%c of event '%s', Event count (approx.): %lu",
+			   "Samples: %lu%c of event '%s', Event count (approx.): %" PRIu64,
 			   nr_samples, unit, ev_name, nr_events);
 
 

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

end of thread, other threads:[~2014-12-12  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-02 17:37 [PATCHv2] perf hists: change print format from lu to PRIu64 Tom Huynh
2014-12-12  8:16 ` [tip:perf/urgent] perf hists browser: Change print format from %lu to %PRIu64 tip-bot for Tom Huynh

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.