aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 695de4b5ae63..e18eb7ed30ae 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -42,9 +42,9 @@ static const char *sym_hist_filter;
42 42
43static int perf_evlist__add_sample(struct perf_evlist *evlist, 43static int perf_evlist__add_sample(struct perf_evlist *evlist,
44 struct perf_sample *sample, 44 struct perf_sample *sample,
45 struct perf_evsel *evsel,
45 struct addr_location *al) 46 struct addr_location *al)
46{ 47{
47 struct perf_evsel *evsel;
48 struct hist_entry *he; 48 struct hist_entry *he;
49 int ret; 49 int ret;
50 50
@@ -59,18 +59,6 @@ static int perf_evlist__add_sample(struct perf_evlist *evlist,
59 return 0; 59 return 0;
60 } 60 }
61 61
62 evsel = perf_evlist__id2evsel(evlist, sample->id);
63 if (evsel == NULL) {
64 /*
65 * FIXME: Propagate this back, but at least we're in a builtin,
66 * where exit() is allowed. ;-)
67 */
68 ui__warning("Invalid %s file, contains samples with id not in "
69 "its header!\n", input_name);
70 exit_browser(0);
71 exit(1);
72 }
73
74 he = __hists__add_entry(&evsel->hists, al, NULL, 1); 62 he = __hists__add_entry(&evsel->hists, al, NULL, 1);
75 if (he == NULL) 63 if (he == NULL)
76 return -ENOMEM; 64 return -ENOMEM;
@@ -92,6 +80,7 @@ static int perf_evlist__add_sample(struct perf_evlist *evlist,
92 80
93static int process_sample_event(union perf_event *event, 81static int process_sample_event(union perf_event *event,
94 struct perf_sample *sample, 82 struct perf_sample *sample,
83 struct perf_evsel *evsel,
95 struct perf_session *session) 84 struct perf_session *session)
96{ 85{
97 struct addr_location al; 86 struct addr_location al;
@@ -103,7 +92,8 @@ static int process_sample_event(union perf_event *event,
103 return -1; 92 return -1;
104 } 93 }
105 94
106 if (!al.filtered && perf_evlist__add_sample(session->evlist, sample, &al)) { 95 if (!al.filtered &&
96 perf_evlist__add_sample(session->evlist, sample, evsel, &al)) {
107 pr_warning("problem incrementing symbol count, " 97 pr_warning("problem incrementing symbol count, "
108 "skipping event\n"); 98 "skipping event\n");
109 return -1; 99 return -1;