From patchwork Fri Oct 2 20:25:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 54456 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 6A3AF23009 for ; Fri, 2 Oct 2015 20:26:12 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf11756956wic.1 for ; Fri, 02 Oct 2015 13:26:11 -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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=IvZOOw85F3d4dHJ9gUacwSH0B4ANKraSix2iq7l4EEM=; b=QNo5w2BjiVOxPKMjIDxCc3FXvoBWtlTWYL0tJhLoqFy3M7wg7DjmB7+Cic7HSeTW21 R5L1+ljQ0zqo21RCWc5nkCo1yAakxLdsGcv59ohkRHNnsWQ7EWdx+65Q7Lt5e3FL3Qd3 pn7b8A1B7zJfP4ry4wKrmqz/rb6kaoeI44sEUJ/M4j2JPJGYkyN+IqG1DCg2cM8vBroc EKY1H6aXco8TqJ9s/qDXvyqy704vK53Qj26SZz293U8VYVY31mZI4fpqWOA7tK+7FY6a Tv6mwAfc/iH3K2jNIze54bKxiCLDBmT5JtStXcVJ+JLWFHv5X8yMooC+l1PC5u24bmrc Bntg== X-Gm-Message-State: ALoCoQnQqe6Fx4QbYPBSaEuEXPRRJhzLyuC2TVHDewbta4qd9tDokCS0GJiIyxn2gza/gOGWGG3S X-Received: by 10.112.209.73 with SMTP id mk9mr2975566lbc.14.1443817571721; Fri, 02 Oct 2015 13:26:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.150.148 with SMTP id y142ls274499lfd.59.gmail; Fri, 02 Oct 2015 13:26:11 -0700 (PDT) X-Received: by 10.25.30.194 with SMTP id e185mr4272983lfe.48.1443817571546; Fri, 02 Oct 2015 13:26:11 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id z7si7329418lbf.45.2015.10.02.13.26.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Oct 2015 13:26:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbbmp1 with SMTP id mp1so32479945lbb.1 for ; Fri, 02 Oct 2015 13:26:11 -0700 (PDT) X-Received: by 10.25.145.132 with SMTP id t126mr4148370lfd.88.1443817571394; Fri, 02 Oct 2015 13:26:11 -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 w3csp1443089lbq; Fri, 2 Oct 2015 13:26:10 -0700 (PDT) X-Received: by 10.66.101.68 with SMTP id fe4mr15895391pab.30.1443817570314; Fri, 02 Oct 2015 13:26:10 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ag1si17630561pad.18.2015.10.02.13.26.10; Fri, 02 Oct 2015 13:26:10 -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 S1751353AbbJBU0E (ORCPT + 30 others); Fri, 2 Oct 2015 16:26:04 -0400 Received: from casper.infradead.org ([85.118.1.10]:49793 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbbJBU0C (ORCPT ); Fri, 2 Oct 2015 16:26:02 -0400 Received: from [181.213.62.138] (helo=zoo.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zi6u0-0002Ln-9d; Fri, 02 Oct 2015 20:26:00 +0000 Received: by zoo.infradead.org (Postfix, from userid 1000) id 11DFF2201D7; Fri, 2 Oct 2015 17:25:51 -0300 (BRT) From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Yang Shi , linaro-kernel@lists.linaro.org, Arnaldo Carvalho de Melo Subject: [PATCH 09/10] perf record: Change 'record.samples' type to unsigned long long Date: Fri, 2 Oct 2015 17:25:44 -0300 Message-Id: <1443817545-8551-10-git-send-email-acme@kernel.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1443817545-8551-1-git-send-email-acme@kernel.org> References: <1443817545-8551-1-git-send-email-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html 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: acme@kernel.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.217.177 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: , From: Yang Shi 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 ran on x86-64, x86, aarch64, arm, mips, ppc and ppc64. Signed-off-by: Yang Shi Cc: linaro-kernel@lists.linaro.org Link: http://lkml.kernel.org/r/1443563383-4064-1-git-send-email-yang.shi@linaro.org [ Bumped the 'hits' var used together with record.samples to 'unsigned long long' too ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-record.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 5e01c070dbf2..24ace2f318c1 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) @@ -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;