diff options
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r-- | tools/perf/builtin-annotate.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 4087ab19823c..0da603b79b61 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -69,15 +69,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel, | |||
69 | if (he == NULL) | 69 | if (he == NULL) |
70 | return -ENOMEM; | 70 | return -ENOMEM; |
71 | 71 | ||
72 | ret = 0; | 72 | ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); |
73 | if (he->ms.sym != NULL) { | ||
74 | struct annotation *notes = symbol__annotation(he->ms.sym); | ||
75 | if (notes->src == NULL && symbol__alloc_hist(he->ms.sym) < 0) | ||
76 | return -ENOMEM; | ||
77 | |||
78 | ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); | ||
79 | } | ||
80 | |||
81 | evsel->hists.stats.total_period += sample->period; | 73 | evsel->hists.stats.total_period += sample->period; |
82 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); | 74 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); |
83 | return ret; | 75 | return ret; |
@@ -188,8 +180,7 @@ find_next: | |||
188 | * symbol, free he->ms.sym->src to signal we already | 180 | * symbol, free he->ms.sym->src to signal we already |
189 | * processed this symbol. | 181 | * processed this symbol. |
190 | */ | 182 | */ |
191 | free(notes->src); | 183 | zfree(¬es->src); |
192 | notes->src = NULL; | ||
193 | } | 184 | } |
194 | } | 185 | } |
195 | } | 186 | } |
@@ -241,7 +232,7 @@ static int __cmd_annotate(struct perf_annotate *ann) | |||
241 | perf_session__fprintf_dsos(session, stdout); | 232 | perf_session__fprintf_dsos(session, stdout); |
242 | 233 | ||
243 | total_nr_samples = 0; | 234 | total_nr_samples = 0; |
244 | list_for_each_entry(pos, &session->evlist->entries, node) { | 235 | evlist__for_each(session->evlist, pos) { |
245 | struct hists *hists = &pos->hists; | 236 | struct hists *hists = &pos->hists; |
246 | u32 nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; | 237 | u32 nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; |
247 | 238 | ||
@@ -373,7 +364,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused) | |||
373 | 364 | ||
374 | if (argc) { | 365 | if (argc) { |
375 | /* | 366 | /* |
376 | * Special case: if there's an argument left then assume tha | 367 | * Special case: if there's an argument left then assume that |
377 | * it's a symbol filter: | 368 | * it's a symbol filter: |
378 | */ | 369 | */ |
379 | if (argc > 1) | 370 | if (argc > 1) |