From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752040AbdH2VYn (ORCPT ); Tue, 29 Aug 2017 17:24:43 -0400 Received: from terminus.zytor.com ([65.50.211.136]:39847 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbdH2VYm (ORCPT ); Tue, 29 Aug 2017 17:24:42 -0400 Date: Tue, 29 Aug 2017 14:22:23 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: jolsa@kernel.org, hpa@zytor.com, a.p.zijlstra@chello.nl, mingo@kernel.org, mark.rutland@arm.com, andi@firstfloor.org, linux-kernel@vger.kernel.org, acme@redhat.com, namhyung@kernel.org, tglx@linutronix.de, alexander.shishkin@linux.intel.com, dsahern@gmail.com Reply-To: andi@firstfloor.org, mark.rutland@arm.com, mingo@kernel.org, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org, hpa@zytor.com, jolsa@kernel.org, dsahern@gmail.com, namhyung@kernel.org, acme@redhat.com, tglx@linutronix.de, alexander.shishkin@linux.intel.com In-Reply-To: <20170824162737.7813-10-jolsa@kernel.org> References: <20170824162737.7813-10-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf report: Group stat values on global event id Git-Commit-ID: 9933183e365f7dd3a79507f1ffb4bcf9433a73ee X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9933183e365f7dd3a79507f1ffb4bcf9433a73ee Gitweb: http://git.kernel.org/tip/9933183e365f7dd3a79507f1ffb4bcf9433a73ee Author: Jiri Olsa AuthorDate: Thu, 24 Aug 2017 18:27:36 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Aug 2017 16:44:44 -0300 perf report: Group stat values on global event id There's no big value on displaying counts for every event ID, which is one per every CPU. Rather than that, displaying the whole sum for the event. $ perf record -c 100000 -e cycles:u -s test $ perf report -T Before: # PID TID cycles:u cycles:u cycles:u cycles:u ... [20 more columns of 'cycles:u'] 3339 3339 0 0 0 0 3340 3340 0 0 0 0 3341 3341 0 0 0 0 3342 3342 0 0 0 0 Now: # PID TID cycles:u 3339 3339 19678 3340 3340 18744 3341 3341 17335 3342 3342 26414 Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20170824162737.7813-10-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-report.c | 2 +- tools/perf/util/values.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 9e4004b0..f9dff65 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -241,7 +241,7 @@ static int process_read_event(struct perf_tool *tool, const char *name = evsel ? perf_evsel__name(evsel) : "unknown"; int err = perf_read_values_add_value(&rep->show_threads_values, event->read.pid, event->read.tid, - event->read.id, + evsel->idx, name, event->read.value); diff --git a/tools/perf/util/values.c b/tools/perf/util/values.c index 3b56aea..8a32bb0 100644 --- a/tools/perf/util/values.c +++ b/tools/perf/util/values.c @@ -192,7 +192,7 @@ int perf_read_values_add_value(struct perf_read_values *values, if (cindex < 0) return cindex; - values->value[tindex][cindex] = value; + values->value[tindex][cindex] += value; return 0; }