public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: acme@redhat.com, jolsa@redhat.com, peterz@infradead.org,
	mingo@elte.hu, dsahern@gmail.com, namhyung@gmail.com
Subject: [PATCH] perf report: fix broken perf report -n on 32-bit systems
Date: Mon, 22 Oct 2012 23:00:25 +0200	[thread overview]
Message-ID: <20121022210025.GA10548@quad> (raw)


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 {

             reply	other threads:[~2012-10-22 21:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 21:00 Stephane Eranian [this message]
2012-10-23 13:48 ` [PATCH] perf report: fix broken perf report -n on 32-bit systems Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121022210025.GA10548@quad \
    --to=eranian@google.com \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung@gmail.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox