All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: change samples type to unsigned long long
@ 2015-09-29 21:49 Yang Shi
  2015-10-02 19:08 ` Arnaldo Carvalho de Melo
  2015-10-03  7:51 ` [tip:perf/core] perf record: Change 'record.samples' " tip-bot for Yang Shi
  0 siblings, 2 replies; 5+ messages in thread
From: Yang Shi @ 2015-09-29 21:49 UTC (permalink / raw)
  To: acme; +Cc: linux-kernel, linaro-kernel, yang.shi

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 is run on x86-64, x86, aarch64, arm, mips, ppc and ppc64.

Signed-off-by: Yang Shi <yang.shi@linaro.org>
---
 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 142eeb3..e54aa4c 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)
-- 
2.0.2


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

end of thread, other threads:[~2015-10-03  7:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-29 21:49 [PATCH] perf: change samples type to unsigned long long Yang Shi
2015-10-02 19:08 ` Arnaldo Carvalho de Melo
2015-10-02 19:10   ` Arnaldo Carvalho de Melo
2015-10-02 21:25     ` Shi, Yang
2015-10-03  7:51 ` [tip:perf/core] perf record: Change 'record.samples' " tip-bot for Yang Shi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.