Re: [PATCH v1 2/2] perf report: Jump to symbol source view from total cycles view

From: Jiri Olsa
Date: Mon Nov 18 2019 - 05:47:46 EST


On Sun, Nov 17, 2019 at 08:12:02PM +0800, Jin, Yao wrote:
>
>
> On 11/15/2019 9:34 PM, Jiri Olsa wrote:
> > On Wed, Nov 13, 2019 at 08:48:52AM +0800, Jin Yao wrote:
> > > This patch supports jumping from tui total cycles view to symbol
> > > source view.
> > >
> > > For example,
> > >
> > > perf record -b ./div
> > > perf report --total-cycles
> > >
> > > In total cycles view, we can select one entry and press 'a' or
> > > press ENTER key to jump to symbol source view.
> > >
> > > Signed-off-by: Jin Yao <yao.jin@xxxxxxxxxxxxxxx>
> > > ---
> > > tools/perf/builtin-report.c | 9 ++++++---
> > > tools/perf/ui/browsers/hists.c | 25 +++++++++++++++++++++++--
> > > tools/perf/util/block-info.c | 6 ++++--
> > > tools/perf/util/block-info.h | 3 ++-
> > > tools/perf/util/hist.h | 7 +++++--
> > > 5 files changed, 40 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> > > index 1e81985b7d56..ceebea4013ca 100644
> > > --- a/tools/perf/builtin-report.c
> > > +++ b/tools/perf/builtin-report.c
> > > @@ -493,7 +493,9 @@ static int perf_evlist__tui_block_hists_browse(struct evlist *evlist,
> > > evlist__for_each_entry(evlist, pos) {
> > > ret = report__browse_block_hists(&rep->block_reports[i++].hist,
> > > - rep->min_percent, pos);
> > > + rep->min_percent, pos,
> > > + &rep->session->header.env,
> > > + &rep->annotation_opts);
> > > if (ret != 0)
> > > return ret;
> > > }
> > > @@ -525,7 +527,8 @@ static int perf_evlist__tty_browse_hists(struct evlist *evlist,
> > > if (rep->total_cycles_mode) {
> > > report__browse_block_hists(&rep->block_reports[i++].hist,
> > > - rep->min_percent, pos);
> > > + rep->min_percent, pos,
> > > + NULL, NULL);
> > > continue;
> > > }
> > > @@ -1418,7 +1421,7 @@ int cmd_report(int argc, const char **argv)
> > > if (sort__mode != SORT_MODE__BRANCH)
> > > report.total_cycles_mode = false;
> > > else
> > > - sort_order = "sym";
> > > + sort_order = NULL;
> >
> > hum, how is this related to this change?
> >
> > jirka
> >
>
> Hi Jiri,
>
> If we set the sort_order to NULL, it will use the default branch sort order.
> The percent value in new annotate view will be consistent with the percent
> in annotate view which is switched from perf report.
>
> I observed the original percent gap with previous patches and then I decide
> to use the default sort order. Now the test result looks good.

ok, plz make note of it in changelog or comment

thanks,
jirka