From patchwork Tue Sep 29 21:49:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 54259 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 3185522B1E for ; Tue, 29 Sep 2015 22:06:43 +0000 (UTC) Received: by labjk1 with SMTP id jk1sf11679625lab.0 for ; Tue, 29 Sep 2015 15:06:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=9S3FxET8bGpDdlOKjiBjaoAQrkxjXsVkL8gAkh5DSaQ=; b=fzfADF5FLDAtDYffcZNLAzwD7OSxwQfS0+7wnADmKBhMoGul7m/27gVY3nGopRobGP 3OMrGy7dhOgaYVdmHobq7gIDCshkkdT4aUzFlB+9ao4UtZZiDiPnd5EBpDywFZrNpxSL 4/5x3UCfSpMYxgyajiT8Oa5H3OdQs5khnB92brF2bjWpM4MNh8Hc9gWyMHvkgg2S6O9c CprbiaOe/cypUIPGzM/HNpgrcG4vf5kVi9VI2qJnLoKPhpw2t4zCjGILmW9/MzOpyBqj 5A6kxmRNKvv+i4hEQCo35t9RduL18G6EuxyJpmeS2RsDf2zlxjGOVEo/Ui6/C6NPFrZx 20pg== X-Gm-Message-State: ALoCoQk0cRXnnMYPhbo4QClHYuixnBmtxP6V6jlXfKNgOqUTc4ceevye/8A/AbmpZiMMI74CjPcv X-Received: by 10.112.125.104 with SMTP id mp8mr40880lbb.20.1443564402002; Tue, 29 Sep 2015 15:06:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.210.198 with SMTP id j189ls5157lfg.86.gmail; Tue, 29 Sep 2015 15:06:41 -0700 (PDT) X-Received: by 10.112.157.99 with SMTP id wl3mr87068lbb.98.1443564401692; Tue, 29 Sep 2015 15:06:41 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id ab1si11924945lbc.108.2015.09.29.15.06.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2015 15:06:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lahh2 with SMTP id h2so25279419lah.0 for ; Tue, 29 Sep 2015 15:06:41 -0700 (PDT) X-Received: by 10.152.28.73 with SMTP id z9mr87230lag.73.1443564401455; Tue, 29 Sep 2015 15:06:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2393264lbq; Tue, 29 Sep 2015 15:06:40 -0700 (PDT) X-Received: by 10.66.146.4 with SMTP id sy4mr368235pab.79.1443564400358; Tue, 29 Sep 2015 15:06:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fy5si40499837pbb.14.2015.09.29.15.06.39; Tue, 29 Sep 2015 15:06:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754678AbbI2WGf (ORCPT + 30 others); Tue, 29 Sep 2015 18:06:35 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:36624 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbbI2WG1 (ORCPT ); Tue, 29 Sep 2015 18:06:27 -0400 Received: by pablk4 with SMTP id lk4so17331073pab.3 for ; Tue, 29 Sep 2015 15:06:27 -0700 (PDT) X-Received: by 10.66.237.6 with SMTP id uy6mr346453pac.129.1443564387200; Tue, 29 Sep 2015 15:06:27 -0700 (PDT) Received: from yshi-Precision-T5600.corp.ad.wrs.com (unknown-216-82.windriver.com. [147.11.216.82]) by smtp.gmail.com with ESMTPSA id jw6sm27426340pbb.86.2015.09.29.15.06.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2015 15:06:26 -0700 (PDT) From: Yang Shi To: acme@redhat.com Cc: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, yang.shi@linaro.org Subject: [PATCH] perf: change samples type to unsigned long long Date: Tue, 29 Sep 2015 14:49:43 -0700 Message-Id: <1443563383-4064-1-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: yang.shi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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)