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-prev] [day] [month] [year] [list]
Date:	Sat, 3 Oct 2015 00:51:19 -0700
From:	tip-bot for Yang Shi <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	hpa@...or.com, mingo@...nel.org, yang.shi@...aro.org,
	linux-kernel@...r.kernel.org, tglx@...utronix.de, acme@...hat.com
Subject: [tip:perf/core] perf record: Change 'record.samples'
  type to unsigned long long

Commit-ID:  9f065194e2a505bb6fd23946b410a0036e9de2ca
Gitweb:     http://git.kernel.org/tip/9f065194e2a505bb6fd23946b410a0036e9de2ca
Author:     Yang Shi <yang.shi@...aro.org>
AuthorDate: Tue, 29 Sep 2015 14:49:43 -0700
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 2 Oct 2015 16:11:08 -0300

perf record: Change 'record.samples' type to unsigned long long

When run "perf record -e", the number of samples showed up is wrong on some
32 bit systems, i.e. powerpc and arm.

For example, run the below commands on 32 bit powerpc:

  perf probe -x /lib/libc.so.6 malloc
  perf record -e probe_libc:malloc -a ls perf.data
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.036 MB perf.data (13829241621624967218 samples) ]

Actually, "perf script" just shows 21 samples. The number of samples is also
absurd since samples is long type, but it is printed as PRIu64.

Build test ran on x86-64, x86, aarch64, arm, mips, ppc and ppc64.

Signed-off-by: Yang Shi <yang.shi@...aro.org>
Cc: linaro-kernel@...ts.linaro.org
Link: http://lkml.kernel.org/r/1443563383-4064-1-git-send-email-yang.shi@linaro.org
[ Bumped the 'hits' var used together with record.samples to 'unsigned long long' too ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-record.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 5e01c07..24ace2f 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -49,7 +49,7 @@ struct record {
 	int			realtime_prio;
 	bool			no_buildid;
 	bool			no_buildid_cache;
-	long			samples;
+	unsigned long long	samples;
 };
 
 static int record__write(struct record *rec, void *bf, size_t size)
@@ -667,7 +667,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 
 	auxtrace_snapshot_enabled = 1;
 	for (;;) {
-		int hits = rec->samples;
+		unsigned long long hits = rec->samples;
 
 		if (record__mmap_read_all(rec) < 0) {
 			auxtrace_snapshot_enabled = 0;
--
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