All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf report: fix broken perf report -n on 32-bit systems
@ 2012-10-22 21:00 Stephane Eranian
  2012-10-23 13:48 ` Namhyung Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Eranian @ 2012-10-22 21:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: acme, jolsa, peterz, mingo, dsahern, namhyung


On 32-bit systems, using perf report -n would yield garbage
for the Samples column. This is because the hpp code was
assuming the hist_entry.stat.nr_events was u64 when in
reality it was u32.

This patch fixes the problem by defining nr_events
to be u64. u32 is too small anyway.

Signed-off-by: Stephane Eranian <eranian@google.com>
---

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index ef2f93c..616757e 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -992,7 +992,7 @@ static int hist_browser__fprintf_entry(struct hist_browser *browser,
 	printed += fprintf(fp, " %5.2f%%", percent);
 
 	if (symbol_conf.show_nr_samples)
-		printed += fprintf(fp, " %11u", he->stat.nr_events);
+		printed += fprintf(fp, " %11"PRIu64, he->stat.nr_events);
 
 	if (symbol_conf.show_total_period)
 		printed += fprintf(fp, " %12" PRIu64, he->stat.period);
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 13761d8..ecda054 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -49,7 +49,7 @@ struct he_stat {
 	u64			period_us;
 	u64			period_guest_sys;
 	u64			period_guest_us;
-	u32			nr_events;
+	u64			nr_events;
 };
 
 struct hist_entry_diff {

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

* Re: [PATCH] perf report: fix broken perf report -n on 32-bit systems
  2012-10-22 21:00 [PATCH] perf report: fix broken perf report -n on 32-bit systems Stephane Eranian
@ 2012-10-23 13:48 ` Namhyung Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Namhyung Kim @ 2012-10-23 13:48 UTC (permalink / raw)
  To: Stephane Eranian; +Cc: linux-kernel, acme, jolsa, peterz, mingo, dsahern

Hi Stephane,

2012-10-22 (월), 23:00 +0200, Stephane Eranian:
> On 32-bit systems, using perf report -n would yield garbage
> for the Samples column. This is because the hpp code was
> assuming the hist_entry.stat.nr_events was u64 when in
> reality it was u32.
> 
> This patch fixes the problem by defining nr_events
> to be u64. u32 is too small anyway.
> 
> Signed-off-by: Stephane Eranian <eranian@google.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung



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

end of thread, other threads:[~2012-10-23 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22 21:00 [PATCH] perf report: fix broken perf report -n on 32-bit systems Stephane Eranian
2012-10-23 13:48 ` Namhyung Kim

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.