From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 01/13] perf top: Move toggling event logic into hists browser
Date: Tue, 23 Jun 2015 18:47:15 -0300 [thread overview]
Message-ID: <1435096047-32088-2-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1435096047-32088-1-git-send-email-acme@kernel.org>
From: Namhyung Kim <namhyung@kernel.org>
Current 'f' key action to enable/disable events won't work if there're
more than one event since perf_evsel_menu__run() doesn't return the key.
So move it to the hists browser loop so that it can be processed as like
other key action, and it's more natural to handle it there IMHO.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1434858076-6533-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-top.c | 24 +++---------------------
tools/perf/ui/browsers/hists.c | 19 +++++++++++++++++--
2 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 619a8696fda7..ecf319728f25 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -586,27 +586,9 @@ static void *display_thread_tui(void *arg)
hists->uid_filter_str = top->record_opts.target.uid_str;
}
- while (true) {
- int key = perf_evlist__tui_browse_hists(top->evlist, help, &hbt,
- top->min_percent,
- &top->session->header.env);
-
- if (key != 'f')
- break;
-
- perf_evlist__toggle_enable(top->evlist);
- /*
- * No need to refresh, resort/decay histogram entries
- * if we are not collecting samples:
- */
- if (top->evlist->enabled) {
- hbt.refresh = top->delay_secs;
- help = "Press 'f' to disable the events or 'h' to see other hotkeys";
- } else {
- help = "Press 'f' again to re-enable the events";
- hbt.refresh = 0;
- }
- }
+ perf_evlist__tui_browse_hists(top->evlist, help, &hbt,
+ top->min_percent,
+ &top->session->header.env);
done = 1;
return NULL;
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index c42adb600091..7629bef2fd79 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1902,8 +1902,23 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
case CTRL('c'):
goto out_free_stack;
case 'f':
- if (!is_report_browser(hbt))
- goto out_free_stack;
+ if (!is_report_browser(hbt)) {
+ struct perf_top *top = hbt->arg;
+
+ perf_evlist__toggle_enable(top->evlist);
+ /*
+ * No need to refresh, resort/decay histogram
+ * entries if we are not collecting samples:
+ */
+ if (top->evlist->enabled) {
+ helpline = "Press 'f' to disable the events or 'h' to see other hotkeys";
+ hbt->refresh = delay_secs;
+ } else {
+ helpline = "Press 'f' again to re-enable the events";
+ hbt->refresh = 0;
+ }
+ continue;
+ }
/* Fall thru */
default:
helpline = "Press '?' for help on key bindings";
--
2.1.0
next prev parent reply other threads:[~2015-06-23 21:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 21:47 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-06-23 21:47 ` Arnaldo Carvalho de Melo [this message]
2015-06-23 21:47 ` [PATCH 02/13] perf tests: Add testing for Makefile.perf Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 03/13] perf tests: Add test for make install with prefix Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 04/13] perf build: Fix single target build dependency check Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 05/13] perf pmu: Use __weak definition from <linux/compiler.h> Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 06/13] perf pmu: Split perf_pmu__new_alias() Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 07/13] perf tools: Allow events with dot Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 08/13] perf session: Print a newline when dumping PERF_RECORD_FINISHED_ROUND Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 09/13] perf tools: Print a newline before dumping Aggregated stats Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 10/13] perf probe: Fix failure to probe events on arm Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 11/13] perf thread_map: Don't access the array entries directly Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 12/13] perf thread_map: Change map entries into a struct Arnaldo Carvalho de Melo
2015-06-25 8:38 ` Jiri Olsa
2015-06-25 13:45 ` Arnaldo Carvalho de Melo
2015-06-25 17:48 ` Arnaldo Carvalho de Melo
2015-06-26 8:43 ` [tip:perf/urgent] perf tools: Future-proof thread_map allocation size calculation tip-bot for Arnaldo Carvalho de Melo
2015-06-23 21:47 ` [PATCH 13/13] perf tools: Allow auxtrace data alignment Arnaldo Carvalho de Melo
2015-06-25 7:31 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
2015-06-25 13:48 ` Arnaldo Carvalho de Melo
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=1435096047-32088-2-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).