From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936573AbcJVIru (ORCPT ); Sat, 22 Oct 2016 04:47:50 -0400 Received: from terminus.zytor.com ([198.137.202.10]:57478 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936323AbcJVIrr (ORCPT ); Sat, 22 Oct 2016 04:47:47 -0400 Date: Sat, 22 Oct 2016 01:47:34 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: dzickus@redhat.com, dsahern@gmail.com, linux-kernel@vger.kernel.org, jmario@redhat.com, acme@redhat.com, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, andi@firstfloor.org, a.p.zijlstra@chello.nl, jolsa@kernel.org, namhyung@kernel.org Reply-To: dsahern@gmail.com, linux-kernel@vger.kernel.org, dzickus@redhat.com, tglx@linutronix.de, hpa@zytor.com, namhyung@kernel.org, jolsa@kernel.org, andi@firstfloor.org, a.p.zijlstra@chello.nl, jmario@redhat.com, acme@redhat.com, mingo@kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf c2c report: Add src line sort key Git-Commit-ID: 89d9ba8f5852f38927bb12cd9e62ffb8b1d89ccd 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: 89d9ba8f5852f38927bb12cd9e62ffb8b1d89ccd Gitweb: http://git.kernel.org/tip/89d9ba8f5852f38927bb12cd9e62ffb8b1d89ccd Author: Jiri Olsa AuthorDate: Sun, 10 Jul 2016 15:47:40 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 19 Oct 2016 13:18:31 -0300 perf c2c report: Add src line sort key It is to be displayed in the single cacheline output: cl_srcline It displays source line related to the code address that accessed cacheline. It's a wrapper to global srcline sort entry. Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Don Zickus Cc: Joe Mario Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-cmnzgm37mjz56ozsg4mnbgxq@git.kernel.org [ Remove __maybe_unused from now used 'he' parameter in filter_cb() ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-c2c.c | 13 ++++++++++++- tools/perf/util/sort.c | 2 +- tools/perf/util/sort.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 2a1e883..0f898d3 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -50,6 +50,8 @@ struct perf_c2c { int cpus_cnt; int *cpu2node; int node_info; + + bool show_src; }; static struct perf_c2c c2c; @@ -1363,6 +1365,11 @@ static struct c2c_dimension dim_cpucnt = { .width = 8, }; +static struct c2c_dimension dim_srcline = { + .name = "cl_srcline", + .se = &sort_srcline, +}; + static struct c2c_dimension *dimensions[] = { &dim_dcacheline, &dim_offset, @@ -1401,6 +1408,7 @@ static struct c2c_dimension *dimensions[] = { &dim_mean_lcl, &dim_mean_load, &dim_cpucnt, + &dim_srcline, NULL, }; @@ -1606,8 +1614,11 @@ static int c2c_hists__reinit(struct c2c_hists *c2c_hists, return hpp_list__parse(&c2c_hists->list, output, sort); } -static int filter_cb(struct hist_entry *he __maybe_unused) +static int filter_cb(struct hist_entry *he) { + if (c2c.show_src && !he->srcline) + he->srcline = hist_entry__get_srcline(he); + return 0; } diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 452e15a..df622f4 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -315,7 +315,7 @@ struct sort_entry sort_sym = { /* --sort srcline */ -static char *hist_entry__get_srcline(struct hist_entry *he) +char *hist_entry__get_srcline(struct hist_entry *he) { struct map *map = he->ms.map; diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 099c975..7aff317 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h @@ -280,4 +280,5 @@ int64_t sort__daddr_cmp(struct hist_entry *left, struct hist_entry *right); int64_t sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right); +char *hist_entry__get_srcline(struct hist_entry *he); #endif /* __PERF_SORT_H */