From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751094AbbJBTIn (ORCPT ); Fri, 2 Oct 2015 15:08:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42039 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879AbbJBTIm (ORCPT ); Fri, 2 Oct 2015 15:08:42 -0400 Date: Fri, 2 Oct 2015 16:08:38 -0300 From: Arnaldo Carvalho de Melo To: Yang Shi Cc: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, acme@kernel.org Subject: Re: [PATCH] perf: change samples type to unsigned long long Message-ID: <20151002190838.GE12682@redhat.com> References: <1443563383-4064-1-git-send-email-yang.shi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1443563383-4064-1-git-send-email-yang.shi@linaro.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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] - Arnaldo > Signed-off-by: Yang Shi > --- > 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