diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 3806ea49f1f7fdcb9dc3faa2f0ef6c56cc7996bf..0ecd62be209193673a35089d87fb759726885d94 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -388,6 +388,11 @@ int machine__resolve_callchain(struct machine *machine, (evsel->attr.sample_type & PERF_SAMPLE_STACK_USER))) return 0; + /* Bail out if nothing was captured. */ + if ((!sample->user_regs.regs) || + (!sample->user_stack.size)) + return 0; + return unwind__get_entries(unwind_entry, &callchain_cursor, machine, thread, evsel->attr.sample_regs_user, sample);