Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1238542

Re: [PATCH] perf: change samples type to unsigned long long

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] perf: change samples type to unsigned long long
Date 2015-10-02 21:20 +0200
Message-ID <qfe25-46r-1@gated-at.bofh.it> (permalink)
References <qebfY-2wi-21@gated-at.bofh.it> <qfdSq-3Vb-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Em Fri, Oct 02, 2015 at 04:08:38PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Sep 29, 2015 at 02:49:43PM -0700, Yang Shi escreveu:
> > 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.
> 
> Sure?
> 
>   AR       /tmp/build/perf/libperf.a
> builtin-record.c: In function ‘__cmd_record’:
> builtin-record.c:689:12: error: comparison between signed and unsigned
> integer expressions [-Werror=sign-compare]

You missed something important, I am fixing this and applying your
patch:

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 974065f8ce80..24ace2f318c1 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] perf: change samples type to unsigned long long Yang Shi <yang.shi@linaro.org> - 2015-09-30 00:10 +0200
  Re: [PATCH] perf: change samples type to unsigned long long Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-10-02 21:10 +0200
    Re: [PATCH] perf: change samples type to unsigned long long Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-02 21:20 +0200
      Re: [PATCH] perf: change samples type to unsigned long long "Shi, Yang" <yang.shi@linaro.org> - 2015-10-02 23:30 +0200
  [tip:perf/core] perf record: Change 'record.samples'   type to unsigned long long tip-bot for Yang Shi <tipbot@zytor.com> - 2015-10-03 10:00 +0200

csiph-web