From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253AbcJJQrp (ORCPT ); Mon, 10 Oct 2016 12:47:45 -0400 Received: from mail.kernel.org ([198.145.29.136]:59046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752771AbcJJQro (ORCPT ); Mon, 10 Oct 2016 12:47:44 -0400 Date: Mon, 10 Oct 2016 13:47:36 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: lkml , Don Zickus , Joe Mario , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , Andi Kleen Subject: Re: [PATCH 39/57] perf c2c report: Add src line sort key Message-ID: <20161010164736.GL4809@kernel.org> References: <1474558645-19956-1-git-send-email-jolsa@kernel.org> <1474558645-19956-40-git-send-email-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1474558645-19956-40-git-send-email-jolsa@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Sep 22, 2016 at 05:37:07PM +0200, Jiri Olsa escreveu: > Adding source line dimension key wrapper. > > 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. > > Link: http://lkml.kernel.org/n/tip-cmnzgm37mjz56ozsg4mnbgxq@git.kernel.org > Signed-off-by: Jiri Olsa > --- > tools/perf/builtin-c2c.c | 11 +++++++++++ > tools/perf/util/sort.c | 2 +- > tools/perf/util/sort.h | 1 + > 3 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c > index 2318249362f8..8fb798c8a790 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; > @@ -1360,6 +1362,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, > @@ -1398,6 +1405,7 @@ static struct c2c_dimension *dimensions[] = { > &dim_mean_lcl, > &dim_mean_load, > &dim_cpucnt, > + &dim_srcline, > NULL, > }; > > @@ -1605,6 +1613,9 @@ static int c2c_hists__reinit(struct c2c_hists *c2c_hists, > > static int filter_cb(struct hist_entry *he __maybe_unused) > { > + if (c2c.show_src && !he->srcline) > + he->srcline = hist_entry__get_srcline(he); > + You forgot to remove the __maybe_unused, doing that myself > return 0; > } > > diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c > index 452e15a10dd2..df622f4e301e 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 099c97557d33..7aff317fc7c4 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 */ > -- > 2.7.4