]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - tools/perf/builtin-report.c
perf report: Sort by sampled cycles percent per block for tui
[linux.git] / tools / perf / builtin-report.c
index ca41187525ede556444d0458767c97c247181693..1e81985b7d569182796f0377315b9f19c1f6f9fe 100644 (file)
@@ -485,6 +485,22 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report
        return ret + fprintf(fp, "\n#\n");
 }
 
+static int perf_evlist__tui_block_hists_browse(struct evlist *evlist,
+                                              struct report *rep)
+{
+       struct evsel *pos;
+       int i = 0, ret;
+
+       evlist__for_each_entry(evlist, pos) {
+               ret = report__browse_block_hists(&rep->block_reports[i++].hist,
+                                                rep->min_percent, pos);
+               if (ret != 0)
+                       return ret;
+       }
+
+       return 0;
+}
+
 static int perf_evlist__tty_browse_hists(struct evlist *evlist,
                                         struct report *rep,
                                         const char *help)
@@ -595,6 +611,11 @@ static int report__browse_hists(struct report *rep)
 
        switch (use_browser) {
        case 1:
+               if (rep->total_cycles_mode) {
+                       ret = perf_evlist__tui_block_hists_browse(evlist, rep);
+                       break;
+               }
+
                ret = perf_evlist__tui_browse_hists(evlist, help, NULL,
                                                    rep->min_percent,
                                                    &session->header.env,
@@ -1396,12 +1417,8 @@ int cmd_report(int argc, const char **argv)
        if (report.total_cycles_mode) {
                if (sort__mode != SORT_MODE__BRANCH)
                        report.total_cycles_mode = false;
-               else if (!report.use_stdio) {
-                       pr_err("Error: --total-cycles can be only used together with --stdio\n");
-                       goto error;
-               } else {
+               else
                        sort_order = "sym";
-               }
        }
 
        if (strcmp(input_name, "-") != 0)