summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index de06bf55efff..dddcc7ea2bec 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -44,6 +44,7 @@ static const char default_pretty_printing_style[] = "normal";
static const char *pretty_printing_style = default_pretty_printing_style;
static char callchain_default_opt[] = "fractal,0.5";
+static symbol_filter_t annotate_init;
static struct hists *perf_session__hists_findnew(struct perf_session *self,
u64 event_stream, u32 type,
@@ -123,7 +124,7 @@ static int perf_session__add_hist_entry(struct perf_session *session,
* All aggregated on the first sym_hist.
*/
struct annotation *notes = symbol__annotation(he->ms.sym);
- if (notes->histograms == NULL &&
+ if (notes->src == NULL &&
symbol__alloc_hist(he->ms.sym, 1) < 0)
err = -ENOMEM;
else
@@ -166,7 +167,8 @@ static int process_sample_event(union perf_event *event,
struct addr_location al;
struct perf_event_attr *attr;
- if (perf_event__preprocess_sample(event, session, &al, sample, NULL) < 0) {
+ if (perf_event__preprocess_sample(event, session, &al, sample,
+ annotate_init) < 0) {
fprintf(stderr, "problem processing %d event, skipping it.\n",
event->header.type);
return -1;
@@ -348,6 +350,12 @@ static int __cmd_report(void)
perf_session__fprintf_dsos(session, stdout);
next = rb_first(&session->hists_tree);
+
+ if (next == NULL) {
+ ui__warning("The %s file has no samples!\n", input_name);
+ goto out_delete;
+ }
+
while (next) {
struct hists *hists;
@@ -519,6 +527,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
*/
if (use_browser > 0) {
symbol_conf.priv_size = sizeof(struct annotation);
+ annotate_init = symbol__annotate_init;
/*
* For searching by name on the "Browse map details".
* providing it only in verbose mode not to bloat too