perf report: Jump to symbol source view from total cycles view
[linux-2.6-microblaze.git] / tools / perf / ui / browsers / hists.c
index 87405dc..d4d3558 100644 (file)
@@ -2385,7 +2385,11 @@ do_annotate(struct hist_browser *browser, struct popup_action *act)
        if (!notes->src)
                return 0;
 
-       evsel = hists_to_evsel(browser->hists);
+       if (browser->block_evsel)
+               evsel = browser->block_evsel;
+       else
+               evsel = hists_to_evsel(browser->hists);
+
        err = map_symbol__tui_annotate(&act->ms, evsel, browser->hbt,
                                       browser->annotation_opts);
        he = hist_browser__selected_entry(browser);
@@ -3461,11 +3465,13 @@ static int block_hists_browser__title(struct hist_browser *browser, char *bf,
 }
 
 int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel,
-                          float min_percent)
+                          float min_percent, struct perf_env *env,
+                          struct annotation_options *annotation_opts)
 {
        struct hists *hists = &bh->block_hists;
        struct hist_browser *browser;
        int key = -1;
+       struct popup_action action;
        static const char help[] =
        " q             Quit \n";
 
@@ -3476,11 +3482,15 @@ int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel,
        browser->block_evsel = evsel;
        browser->title = block_hists_browser__title;
        browser->min_pcnt = min_percent;
+       browser->env = env;
+       browser->annotation_opts = annotation_opts;
 
        /* reset abort key so that it can get Ctrl-C as a key */
        SLang_reset_tty();
        SLang_init_tty(0, 0, 0);
 
+       memset(&action, 0, sizeof(action));
+
        while (1) {
                key = hist_browser__run(browser, "? - help", true);
 
@@ -3490,6 +3500,17 @@ int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel,
                case '?':
                        ui_browser__help_window(&browser->b, help);
                        break;
+               case 'a':
+               case K_ENTER:
+                       if (!browser->selection ||
+                           !browser->selection->sym) {
+                               continue;
+                       }
+
+                       action.ms.map = browser->selection->map;
+                       action.ms.sym = browser->selection->sym;
+                       do_annotate(browser, &action);
+                       continue;
                default:
                        break;
                }