public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Jin, Yao" <yao.jin@linux.intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
	mingo@redhat.com, alexander.shishkin@linux.intel.com,
	Linux-kernel@vger.kernel.org, ak@linux.intel.com,
	kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH v5 4/4] perf report: support hotkey to let user select any event for sorting
Date: Thu, 19 Dec 2019 13:43:20 +0100	[thread overview]
Message-ID: <20191219124320.GA31264@krava> (raw)
In-Reply-To: <c1f18601-41d5-451d-4278-b7adb08674c3@linux.intel.com>

On Thu, Dec 19, 2019 at 08:38:39PM +0800, Jin, Yao wrote:
> 
> 
> On 12/19/2019 5:10 PM, Jiri Olsa wrote:
> > On Thu, Dec 19, 2019 at 02:09:29PM +0800, Jin Yao wrote:
> > 
> > SNIP
> > 
> > > +		case '0' ... '9':
> > > +			if (!symbol_conf.event_group ||
> > > +			    evsel->core.nr_members < 2) {
> > > +				snprintf(buf, sizeof(buf),
> > > +					 "Sort by index only available with group events!");
> > > +				helpline = buf;
> > > +				continue;
> > > +			}
> > > +
> > > +			symbol_conf.group_sort_idx = key - '0';
> > > +
> > > +			if (symbol_conf.group_sort_idx >= evsel->core.nr_members) {
> > > +				snprintf(buf, sizeof(buf),
> > > +					 "Max event group index to sort is %d (index from 0 to %d)",
> > > +					 evsel->core.nr_members - 1,
> > > +					 evsel->core.nr_members - 1);
> > > +				helpline = buf;
> > > +				continue;
> > > +			}
> > > +
> > > +			key = K_RELOAD;
> > > +			goto out_free_stack;
> > >   		case 'a':
> > >   			if (!hists__has(hists, sym)) {
> > >   				ui_browser__warning(&browser->b, delay_secs * 2,
> > > -- 
> > > 2.17.1
> > > 
> > 
> > maybe also something like this to eliminate unneeded refresh?
> > 
> > jirka
> > 
> > 
> > ---
> > diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> > index 22e76bd1a2d9..9f5dd48500a2 100644
> > --- a/tools/perf/ui/browsers/hists.c
> > +++ b/tools/perf/ui/browsers/hists.c
> > @@ -2947,6 +2947,9 @@ static int perf_evsel__hists_browse(struct evsel *evsel, int nr_events,
> >   				continue;
> >   			}
> > +			if (key - '0' == symbol_conf.group_sort_idx)
> > +				continue;
> > +
> >   			symbol_conf.group_sort_idx = key - '0';
> >   			if (symbol_conf.group_sort_idx >= evsel->core.nr_members) {
> > 
> 
> Hi Jiri,
> 
> Thanks, I think it's a good improvement. It can avoid the unnecessary
> refresh.
> 
> If no more comments on this patch-set, I will add this improvement and then
> post v6.

sure, I don't have any more comments

jirka


      reply	other threads:[~2019-12-19 12:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19  6:09 [PATCH v5 1/4] perf report: Fix incorrectly added dimensions as switch perf data file Jin Yao
2019-12-19  6:09 ` [PATCH v5 2/4] perf report: Change sort order by a specified event in group Jin Yao
2019-12-19  6:09 ` [PATCH v5 3/4] perf report: Support a new key to reload the browser Jin Yao
2019-12-19  6:09 ` [PATCH v5 4/4] perf report: support hotkey to let user select any event for sorting Jin Yao
2019-12-19  9:10   ` Jiri Olsa
2019-12-19 12:38     ` Jin, Yao
2019-12-19 12:43       ` Jiri Olsa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191219124320.GA31264@krava \
    --to=jolsa@redhat.com \
    --cc=Linux-kernel@vger.kernel.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=yao.jin@intel.com \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox