lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 1 Jul 2015 09:05:36 +0000
From:	He Kuang <hekuang@...wei.com>
To:	<acme@...nel.org>, <a.p.zijlstra@...llo.nl>, <mingo@...hat.com>,
	<masami.hiramatsu.pt@...achi.com>, <namhyung@...nel.org>,
	<jolsa@...nel.org>
CC:	<wangnan0@...wei.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/4] perf record: Use %ld for long type sample counter

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@...wei.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ