perf annotate: Support multiple histograms in annotation
[deliverable/linux.git] / tools / perf / builtin-report.c
index 91e4cdba933beb4f1bb87e3bc885318da030b6d0..de06bf55efffafd5cb11b1126b780ceb4e6b3db5 100644 (file)
@@ -118,8 +118,17 @@ static int perf_session__add_hist_entry(struct perf_session *session,
         * so we don't allocated the extra space needed because the stdio
         * code will not use it.
         */
-       if (use_browser > 0)
-               err = hist_entry__inc_addr_samples(he, al->addr);
+       if (al->sym != NULL && use_browser > 0) {
+               /*
+                * All aggregated on the first sym_hist.
+                */
+               struct annotation *notes = symbol__annotation(he->ms.sym);
+               if (notes->histograms == NULL &&
+                   symbol__alloc_hist(he->ms.sym, 1) < 0)
+                       err = -ENOMEM;
+               else
+                       err = hist_entry__inc_addr_samples(he, 0, al->addr);
+       }
 
        return err;
 }
@@ -349,7 +358,7 @@ static int __cmd_report(void)
        }
 
        if (use_browser > 0)
-               hists__tui_browse_tree(&session->hists_tree, help);
+               hists__tui_browse_tree(&session->hists_tree, help, 0);
        else
                hists__tty_browse_tree(&session->hists_tree, help);
 
This page took 0.030783 seconds and 5 git commands to generate.