aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 105f00bfd555..e6a07408669e 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -242,17 +242,16 @@ static bool symbol__match_parent_regex(struct symbol *sym)
242 return 0; 242 return 0;
243} 243}
244 244
245struct map_symbol *perf_session__resolve_callchain(struct perf_session *self, 245int perf_session__resolve_callchain(struct perf_session *self,
246 struct thread *thread, 246 struct thread *thread,
247 struct ip_callchain *chain, 247 struct ip_callchain *chain,
248 struct symbol **parent) 248 struct symbol **parent)
249{ 249{
250 u8 cpumode = PERF_RECORD_MISC_USER; 250 u8 cpumode = PERF_RECORD_MISC_USER;
251 unsigned int i; 251 unsigned int i;
252 struct map_symbol *syms = calloc(chain->nr, sizeof(*syms)); 252 int err;
253 253
254 if (!syms) 254 callchain_cursor_reset(&self->callchain_cursor);
255 return NULL;
256 255
257 for (i = 0; i < chain->nr; i++) { 256 for (i = 0; i < chain->nr; i++) {
258 u64 ip = chain->ips[i]; 257 u64 ip = chain->ips[i];
@@ -281,12 +280,15 @@ struct map_symbol *perf_session__resolve_callchain(struct perf_session *self,
281 *parent = al.sym; 280 *parent = al.sym;
282 if (!symbol_conf.use_callchain) 281 if (!symbol_conf.use_callchain)
283 break; 282 break;
284 syms[i].map = al.map;
285 syms[i].sym = al.sym;
286 } 283 }
284
285 err = callchain_cursor_append(&self->callchain_cursor,
286 ip, al.map, al.sym);
287 if (err)
288 return err;
287 } 289 }
288 290
289 return syms; 291 return 0;
290} 292}
291 293
292static int process_event_synth_stub(event_t *event __used, 294static int process_event_synth_stub(event_t *event __used,
@@ -494,7 +496,7 @@ static void flush_sample_queue(struct perf_session *s,
494 if (iter->timestamp > limit) 496 if (iter->timestamp > limit)
495 break; 497 break;
496 498
497 event__parse_sample(iter->event, s, &sample); 499 perf_session__parse_sample(s, iter->event, &sample);
498 perf_session_deliver_event(s, iter->event, &sample, ops, 500 perf_session_deliver_event(s, iter->event, &sample, ops,
499 iter->file_offset); 501 iter->file_offset);
500 502
@@ -804,7 +806,7 @@ static int perf_session__process_event(struct perf_session *session,
804 /* 806 /*
805 * For all kernel events we get the sample data 807 * For all kernel events we get the sample data
806 */ 808 */
807 event__parse_sample(event, session, &sample); 809 perf_session__parse_sample(session, event, &sample);
808 810
809 /* Preprocess sample records - precheck callchains */ 811 /* Preprocess sample records - precheck callchains */
810 if (perf_session__preprocess_sample(session, event, &sample)) 812 if (perf_session__preprocess_sample(session, event, &sample))