public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] perf record: Use %ld for long type sample counter
@ 2015-07-01  9:05 He Kuang
  2015-07-01  9:05 ` [PATCH 2/4] perf probe: Fix failure to probe online module He Kuang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: He Kuang @ 2015-07-01  9:05 UTC (permalink / raw)
  To: acme, a.p.zijlstra, mingo, masami.hiramatsu.pt, namhyung, jolsa
  Cc: wangnan0, linux-kernel

Since we post-process and count (long rec->samples) to show precise
number of samples instead of estimate on (u64 rec->bytes_written), the
format string of that should be changed to %ld accordingly, otherwise
the value don't show right on 32bit machine.

Before this patch:

  $ perf record -e syscalls:sys_enter_write -- dd if=/dev/zero
  of=/dev/null bs=4k count=1000
  1000+0 records in
  1000+0 records out
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.077 MB perf.data (1 samples) ]

After this patch:

  $ perf record -e syscalls:sys_enter_write -- dd if=/dev/zero
   of=/dev/null bs=4k count=1000
  1000+0 records in
  1000+0 records out
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.077 MB perf.data (1001 samples) ]

Signed-off-by: He Kuang <hekuang@huawei.com>
---
 tools/perf/builtin-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index de165a1..65e632d 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -737,7 +737,7 @@ out_child:
 
 		if (rec->samples && !rec->opts.full_auxtrace)
 			scnprintf(samples, sizeof(samples),
-				  " (%" PRIu64 " samples)", rec->samples);
+				  " (%ld samples)", rec->samples);
 		else
 			samples[0] = '\0';
 
-- 
1.8.5.2


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

end of thread, other threads:[~2015-07-01 12:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-01  9:05 [PATCH 1/4] perf record: Use %ld for long type sample counter He Kuang
2015-07-01  9:05 ` [PATCH 2/4] perf probe: Fix failure to probe online module He Kuang
2015-07-01 11:14   ` Masami Hiramatsu
2015-07-01  9:05 ` [PATCH 3/4] perf probe: Enable --range option according to libdw version He Kuang
2015-07-01 11:02   ` Masami Hiramatsu
2015-07-01  9:05 ` [PATCH 4/4] perf probe: Add failure check when show variable range He Kuang
2015-07-01 11:00   ` Masami Hiramatsu
2015-07-01 11:53     ` [PATCH v2 1/2] perf probe: Enable --range option according to libdw version He Kuang
2015-07-01 11:53       ` [PATCH v2 2/2] perf probe: Add failure check when show variable range He Kuang
2015-07-01 12:00     ` [PATCH 4/4] " He Kuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox