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 10:10:08 +0100	[thread overview]
Message-ID: <20191219091008.GB8141@krava> (raw)
In-Reply-To: <20191219060929.3714-4-yao.jin@linux.intel.com>

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) {


  reply	other threads:[~2019-12-19  9:10 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 [this message]
2019-12-19 12:38     ` Jin, Yao
2019-12-19 12:43       ` Jiri Olsa

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=20191219091008.GB8141@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