diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-03-16 04:50:53 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-03-16 15:34:13 -0400 |
commit | 938a23ae7f656ffde9dd67e83dddf4406f85d773 (patch) | |
tree | 6267df3c31d87762a1490d33073b4e709a8d6a11 /tools | |
parent | aa49f6ec990baa9d8f1b46a86fc169a8028776d4 (diff) |
perf ui browser: Add 's' key to filter by symbol name
Now user can enter symbol name interested via ui_browser__input_window,
and perf can process it using hists__filter_by_symbol(). Giving empty
symbol (by pressing 's' followed by ENTER) will disable the filtering.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1331887855-874-3-git-send-email-namhyung.kim@lge.com
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/ui/browsers/hists.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c index de8ece8bcce3..c4173c9733bb 100644 --- a/tools/perf/util/ui/browsers/hists.c +++ b/tools/perf/util/ui/browsers/hists.c | |||
@@ -879,6 +879,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
879 | char *options[16]; | 879 | char *options[16]; |
880 | int nr_options = 0; | 880 | int nr_options = 0; |
881 | int key = -1; | 881 | int key = -1; |
882 | char buf[64]; | ||
882 | 883 | ||
883 | if (browser == NULL) | 884 | if (browser == NULL) |
884 | return -1; | 885 | return -1; |
@@ -933,6 +934,16 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
933 | goto zoom_dso; | 934 | goto zoom_dso; |
934 | case 't': | 935 | case 't': |
935 | goto zoom_thread; | 936 | goto zoom_thread; |
937 | case 's': | ||
938 | if (ui_browser__input_window("Symbol to show", | ||
939 | "Please enter the name of symbol you want to see", | ||
940 | buf, "ENTER: OK, ESC: Cancel", | ||
941 | delay_secs * 2) == K_ENTER) { | ||
942 | self->symbol_filter_str = *buf ? buf : NULL; | ||
943 | hists__filter_by_symbol(self); | ||
944 | hist_browser__reset(browser); | ||
945 | } | ||
946 | continue; | ||
936 | case K_F1: | 947 | case K_F1: |
937 | case 'h': | 948 | case 'h': |
938 | case '?': | 949 | case '?': |
@@ -950,7 +961,8 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
950 | "C Collapse all callchains\n" | 961 | "C Collapse all callchains\n" |
951 | "E Expand all callchains\n" | 962 | "E Expand all callchains\n" |
952 | "d Zoom into current DSO\n" | 963 | "d Zoom into current DSO\n" |
953 | "t Zoom into current Thread"); | 964 | "t Zoom into current Thread\n" |
965 | "s Filter symbol by name"); | ||
954 | continue; | 966 | continue; |
955 | case K_ENTER: | 967 | case K_ENTER: |
956 | case K_RIGHT: | 968 | case K_RIGHT: |