All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Yang Shi <yang.shi@linaro.org>
Cc: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org
Subject: Re: [PATCH] perf: change samples type to unsigned long long
Date: Fri, 2 Oct 2015 16:10:59 -0300	[thread overview]
Message-ID: <20151002191059.GA20515@kernel.org> (raw)
In-Reply-To: <20151002190838.GE12682@redhat.com>

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;

  reply	other threads:[~2015-10-02 19:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20151002191059.GA20515@kernel.org \
    --to=acme@kernel.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yang.shi@linaro.org \
    /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 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.