diff options
| -rw-r--r-- | tools/perf/util/newt.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index 139eb1a16cd8..6974431d212f 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c | |||
| @@ -752,6 +752,10 @@ static int hist_browser__populate(struct hist_browser *self, struct hists *hists | |||
| 752 | 752 | ||
| 753 | newtFormAddHotKey(self->form, 'A'); | 753 | newtFormAddHotKey(self->form, 'A'); |
| 754 | newtFormAddHotKey(self->form, 'a'); | 754 | newtFormAddHotKey(self->form, 'a'); |
| 755 | newtFormAddHotKey(self->form, 'D'); | ||
| 756 | newtFormAddHotKey(self->form, 'd'); | ||
| 757 | newtFormAddHotKey(self->form, 'T'); | ||
| 758 | newtFormAddHotKey(self->form, 't'); | ||
| 755 | newtFormAddHotKey(self->form, NEWT_KEY_RIGHT); | 759 | newtFormAddHotKey(self->form, NEWT_KEY_RIGHT); |
| 756 | newtFormAddHotKey(self->form, NEWT_KEY_LEFT); | 760 | newtFormAddHotKey(self->form, NEWT_KEY_LEFT); |
| 757 | newtFormAddComponents(self->form, self->tree, NULL); | 761 | newtFormAddComponents(self->form, self->tree, NULL); |
| @@ -834,9 +838,20 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na | |||
| 834 | annotate = -2, zoom_dso = -2, zoom_thread = -2; | 838 | annotate = -2, zoom_dso = -2, zoom_thread = -2; |
| 835 | 839 | ||
| 836 | newtFormRun(browser->form, &es); | 840 | newtFormRun(browser->form, &es); |
| 841 | |||
| 842 | thread = hist_browser__selected_thread(browser); | ||
| 843 | dso = browser->selection->map ? browser->selection->map->dso : NULL; | ||
| 844 | |||
| 837 | if (es.reason == NEWT_EXIT_HOTKEY) { | 845 | if (es.reason == NEWT_EXIT_HOTKEY) { |
| 838 | if (toupper(es.u.key) == 'A') | 846 | switch (toupper(es.u.key)) { |
| 847 | case 'A': | ||
| 839 | goto do_annotate; | 848 | goto do_annotate; |
| 849 | case 'D': | ||
| 850 | goto zoom_dso; | ||
| 851 | case 'T': | ||
| 852 | goto zoom_thread; | ||
| 853 | default:; | ||
| 854 | } | ||
| 840 | if (toupper(es.u.key) == 'Q' || | 855 | if (toupper(es.u.key) == 'Q' || |
| 841 | es.u.key == CTRL('c')) | 856 | es.u.key == CTRL('c')) |
| 842 | break; | 857 | break; |
| @@ -866,7 +881,6 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na | |||
| 866 | browser->selection->sym->name) > 0) | 881 | browser->selection->sym->name) > 0) |
| 867 | annotate = nr_options++; | 882 | annotate = nr_options++; |
| 868 | 883 | ||
| 869 | thread = hist_browser__selected_thread(browser); | ||
| 870 | if (thread != NULL && | 884 | if (thread != NULL && |
| 871 | asprintf(&options[nr_options], "Zoom %s %s(%d) thread", | 885 | asprintf(&options[nr_options], "Zoom %s %s(%d) thread", |
| 872 | (thread_filter ? "out of" : "into"), | 886 | (thread_filter ? "out of" : "into"), |
| @@ -874,7 +888,6 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na | |||
| 874 | thread->pid) > 0) | 888 | thread->pid) > 0) |
| 875 | zoom_thread = nr_options++; | 889 | zoom_thread = nr_options++; |
| 876 | 890 | ||
| 877 | dso = browser->selection->map ? browser->selection->map->dso : NULL; | ||
| 878 | if (dso != NULL && | 891 | if (dso != NULL && |
| 879 | asprintf(&options[nr_options], "Zoom %s %s DSO", | 892 | asprintf(&options[nr_options], "Zoom %s %s DSO", |
| 880 | (dso_filter ? "out of" : "into"), | 893 | (dso_filter ? "out of" : "into"), |
| @@ -910,12 +923,15 @@ do_annotate: | |||
| 910 | 923 | ||
| 911 | hist_entry__annotate_browser(he); | 924 | hist_entry__annotate_browser(he); |
| 912 | } else if (choice == zoom_dso) { | 925 | } else if (choice == zoom_dso) { |
| 926 | zoom_dso: | ||
| 913 | if (dso_filter) { | 927 | if (dso_filter) { |
| 914 | pstack__remove(fstack, &dso_filter); | 928 | pstack__remove(fstack, &dso_filter); |
| 915 | zoom_out_dso: | 929 | zoom_out_dso: |
| 916 | ui_helpline__pop(); | 930 | ui_helpline__pop(); |
| 917 | dso_filter = NULL; | 931 | dso_filter = NULL; |
| 918 | } else { | 932 | } else { |
| 933 | if (dso == NULL) | ||
| 934 | continue; | ||
| 919 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s DSO\"", | 935 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s DSO\"", |
| 920 | dso->kernel ? "the Kernel" : dso->short_name); | 936 | dso->kernel ? "the Kernel" : dso->short_name); |
| 921 | dso_filter = dso; | 937 | dso_filter = dso; |
| @@ -927,6 +943,7 @@ zoom_out_dso: | |||
| 927 | if (hist_browser__populate(browser, self, msg) < 0) | 943 | if (hist_browser__populate(browser, self, msg) < 0) |
| 928 | goto out; | 944 | goto out; |
| 929 | } else if (choice == zoom_thread) { | 945 | } else if (choice == zoom_thread) { |
| 946 | zoom_thread: | ||
| 930 | if (thread_filter) { | 947 | if (thread_filter) { |
| 931 | pstack__remove(fstack, &thread_filter); | 948 | pstack__remove(fstack, &thread_filter); |
| 932 | zoom_out_thread: | 949 | zoom_out_thread: |
