mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: He Kuang <hekuang@huawei.com>
To: <acme@kernel.org>, <a.p.zijlstra@chello.nl>, <mingo@redhat.com>,
	<masami.hiramatsu.pt@hitachi.com>, <namhyung@kernel.org>,
	<jolsa@kernel.org>
Cc: <wangnan0@huawei.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/4] perf record: Use %ld for long type sample counter
Date: Wed, 1 Jul 2015 09:05:36 +0000	[thread overview]
Message-ID: <1435741539-44100-1-git-send-email-hekuang@huawei.com> (raw)

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


             reply	other threads:[~2015-07-01  9:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  9:05 He Kuang [this message]
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

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=1435741539-44100-1-git-send-email-hekuang@huawei.com \
    --to=hekuang@huawei.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.com \
    /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

all inboxes | Powered by JetHome®