]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/builtin-report.c
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / tools / perf / builtin-report.c
index 3750d635f0f7507df319045a43a73bb58668e906..140a6cd883514b0b14f65a8d7c5fe3e082a8cc64 100644 (file)
@@ -257,6 +257,13 @@ static int report__setup_sample_type(struct report *rep)
                }
        }
 
+       if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) {
+               if ((sample_type & PERF_SAMPLE_REGS_USER) &&
+                   (sample_type & PERF_SAMPLE_STACK_USER))
+                       callchain_param.record_mode = CALLCHAIN_DWARF;
+               else
+                       callchain_param.record_mode = CALLCHAIN_FP;
+       }
        return 0;
 }
 
@@ -487,6 +494,7 @@ static int __cmd_report(struct report *rep)
 
                if (dump_trace) {
                        perf_session__fprintf_nr_events(session, stdout);
+                       perf_evlist__fprintf_nr_events(session->evlist, stdout);
                        return 0;
                }
        }
@@ -567,7 +575,6 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
        struct stat st;
        bool has_br_stack = false;
        int branch_mode = -1;
-       int ret = -1;
        char callchain_default_opt[] = "fractal,0.5,callee";
        const char * const report_usage[] = {
                "perf report [<options>]",
@@ -694,6 +701,10 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
        struct perf_data_file file = {
                .mode  = PERF_DATA_MODE_READ,
        };
+       int ret = hists__init();
+
+       if (ret < 0)
+               return ret;
 
        perf_config(report__config, &report);