diff options
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index c27e31f289e6..c95599a82f9e 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -81,18 +81,17 @@ static int perf_session__add_hist_entry(struct perf_session *self, | |||
81 | struct addr_location *al, | 81 | struct addr_location *al, |
82 | struct sample_data *data) | 82 | struct sample_data *data) |
83 | { | 83 | { |
84 | struct map_symbol *syms = NULL; | ||
85 | struct symbol *parent = NULL; | 84 | struct symbol *parent = NULL; |
86 | int err = -ENOMEM; | 85 | int err = 0; |
87 | struct hist_entry *he; | 86 | struct hist_entry *he; |
88 | struct hists *hists; | 87 | struct hists *hists; |
89 | struct perf_event_attr *attr; | 88 | struct perf_event_attr *attr; |
90 | 89 | ||
91 | if ((sort__has_parent || symbol_conf.use_callchain) && data->callchain) { | 90 | if ((sort__has_parent || symbol_conf.use_callchain) && data->callchain) { |
92 | syms = perf_session__resolve_callchain(self, al->thread, | 91 | err = perf_session__resolve_callchain(self, al->thread, |
93 | data->callchain, &parent); | 92 | data->callchain, &parent); |
94 | if (syms == NULL) | 93 | if (err) |
95 | return -ENOMEM; | 94 | return err; |
96 | } | 95 | } |
97 | 96 | ||
98 | attr = perf_header__find_attr(data->id, &self->header); | 97 | attr = perf_header__find_attr(data->id, &self->header); |
@@ -101,16 +100,17 @@ static int perf_session__add_hist_entry(struct perf_session *self, | |||
101 | else | 100 | else |
102 | hists = perf_session__hists_findnew(self, data->id, 0, 0); | 101 | hists = perf_session__hists_findnew(self, data->id, 0, 0); |
103 | if (hists == NULL) | 102 | if (hists == NULL) |
104 | goto out_free_syms; | 103 | return -ENOMEM; |
104 | |||
105 | he = __hists__add_entry(hists, al, parent, data->period); | 105 | he = __hists__add_entry(hists, al, parent, data->period); |
106 | if (he == NULL) | 106 | if (he == NULL) |
107 | goto out_free_syms; | 107 | return -ENOMEM; |
108 | err = 0; | 108 | |
109 | if (symbol_conf.use_callchain) { | 109 | if (symbol_conf.use_callchain) { |
110 | err = callchain_append(he->callchain, data->callchain, syms, | 110 | err = callchain_append(he->callchain, &self->callchain_cursor, |
111 | data->period); | 111 | data->period); |
112 | if (err) | 112 | if (err) |
113 | goto out_free_syms; | 113 | return err; |
114 | } | 114 | } |
115 | /* | 115 | /* |
116 | * Only in the newt browser we are doing integrated annotation, | 116 | * Only in the newt browser we are doing integrated annotation, |
@@ -119,8 +119,7 @@ static int perf_session__add_hist_entry(struct perf_session *self, | |||
119 | */ | 119 | */ |
120 | if (use_browser > 0) | 120 | if (use_browser > 0) |
121 | err = hist_entry__inc_addr_samples(he, al->addr); | 121 | err = hist_entry__inc_addr_samples(he, al->addr); |
122 | out_free_syms: | 122 | |
123 | free(syms); | ||
124 | return err; | 123 | return err; |
125 | } | 124 | } |
126 | 125 | ||