From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751434AbbJBVZ4 (ORCPT ); Fri, 2 Oct 2015 17:25:56 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:34696 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbbJBVZz (ORCPT ); Fri, 2 Oct 2015 17:25:55 -0400 Message-ID: <560EF661.807@linaro.org> Date: Fri, 02 Oct 2015 14:25:53 -0700 From: "Shi, Yang" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org Subject: Re: [PATCH] perf: change samples type to unsigned long long References: <1443563383-4064-1-git-send-email-yang.shi@linaro.org> <20151002190838.GE12682@redhat.com> <20151002191059.GA20515@kernel.org> In-Reply-To: <20151002191059.GA20515@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/2/2015 12:10 PM, Arnaldo Carvalho de Melo wrote: > 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: Thanks a lot. Yes, it was wrong, however, my compiler just throws a warning instead of an error. And, the warning was hidden by my OE build environment. Regards, Yang > > 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; >