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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index ea6a1165956..427182953fd 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -62,7 +62,8 @@ static int hists__add_entry(struct hists *self, struct addr_location *al)
62 * All aggregated on the first sym_hist. 62 * All aggregated on the first sym_hist.
63 */ 63 */
64 struct annotation *notes = symbol__annotation(he->ms.sym); 64 struct annotation *notes = symbol__annotation(he->ms.sym);
65 if (notes->histograms == NULL && symbol__alloc_hist(he->ms.sym, 1) < 0) 65 if (notes->src == NULL &&
66 symbol__alloc_hist(he->ms.sym, 1) < 0)
66 return -ENOMEM; 67 return -ENOMEM;
67 68
68 return hist_entry__inc_addr_samples(he, 0, al->addr); 69 return hist_entry__inc_addr_samples(he, 0, al->addr);
@@ -77,7 +78,8 @@ static int process_sample_event(union perf_event *event,
77{ 78{
78 struct addr_location al; 79 struct addr_location al;
79 80
80 if (perf_event__preprocess_sample(event, session, &al, sample, NULL) < 0) { 81 if (perf_event__preprocess_sample(event, session, &al, sample,
82 symbol__annotate_init) < 0) {
81 pr_warning("problem processing %d event, skipping it.\n", 83 pr_warning("problem processing %d event, skipping it.\n",
82 event->header.type); 84 event->header.type);
83 return -1; 85 return -1;
@@ -111,7 +113,7 @@ static void hists__find_annotations(struct hists *self)
111 goto find_next; 113 goto find_next;
112 114
113 notes = symbol__annotation(he->ms.sym); 115 notes = symbol__annotation(he->ms.sym);
114 if (notes->histograms == NULL) { 116 if (notes->src == NULL) {
115find_next: 117find_next:
116 if (key == KEY_LEFT) 118 if (key == KEY_LEFT)
117 nd = rb_prev(nd); 119 nd = rb_prev(nd);
@@ -142,11 +144,11 @@ find_next:
142 nd = rb_next(nd); 144 nd = rb_next(nd);
143 /* 145 /*
144 * Since we have a hist_entry per IP for the same 146 * Since we have a hist_entry per IP for the same
145 * symbol, free he->ms.sym->histogram to signal we already 147 * symbol, free he->ms.sym->src to signal we already
146 * processed this symbol. 148 * processed this symbol.
147 */ 149 */
148 free(notes->histograms); 150 free(notes->src);
149 notes->histograms = NULL; 151 notes->src = NULL;
150 } 152 }
151 } 153 }
152} 154}