perf hists browser: Allow passing an initial hotkey
A message that is not in the archive (sent off-list or not yet received): [email protected]
The following commit has been merged into the perf/core branch of tip:
Commit-ID: d10ec006dcd7b20b2eb7e9ef32fc6f83b0112893 Gitweb: https://git.kernel.org/tip/d10ec006dcd7b20b2eb7e9ef32fc6f83b0112893 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Thu, 12 Dec 2019 15:31:40 -03:00 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitterDate: Mon, 06 Jan 2020 11:46:10 -03:00
perf hists browser: Allow passing an initial hotkey
Sometimes we're in an outer code, like the main hists browser popup menu and the user follows a suggestion about using some hotkey, and that hotkey is really handled by hists_browser__run(), so allow for calling it with that hotkey, making it handle it instead of waiting for the user to press one.
Reviewed-by Jiri Olsa <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Jin Yao <[email protected]>
Cc Kan Liang <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Namhyung Kim <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-c2c.c | 4 +- tools/perf/ui/browsers/hists.c | 153 ++++++++++++++++---------------- tools/perf/ui/browsers/hists.h | 2 +- 3 files changed, 82 insertions(+), 77 deletions(-)
tools/perf/builtin-c2c.c +2 -2
@@ -2384,7 +2384,7 @@ static int perf_c2c__browse_cacheline(struct hist_entry *he)c2c_browser__update_nr_entries (browser);while (1 ) { - key =hist_browser__run (browser,"? - help" , true); + key =hist_browser__run (browser,"? - help" , true,0 );switch (key) {case 's' :
@@ -2453,7 +2453,7 @@ static int perf_c2c__hists_browse(struct hists *hists)c2c_browser__update_nr_entries (browser);while (1 ) { - key =hist_browser__run (browser,"? - help" , true); + key =hist_browser__run (browser,"? - help" , true,0 );switch (key) {case 'q' :
tools/perf/ui/browsers/hists.c +79 -74
183 lines not on this page · raw message
tools/perf/ui/browsers/hists.h +1 -1
@@ -34,7 +34,7 @@ struct hist_browser {struct hist_browser *hist_browser__new (struct hists *hists);void hist_browser__delete (struct hist_browser *browser);int hist_browser__run (struct hist_browser *browser,const char *help, -bool warn_lost_event); +bool warn_lost_event,int key);void hist_browser__init (struct hist_browser *browser,struct hists *hists);#endif /* _PERF_UI_BROWSER_HISTS_H_ */