Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Do backtrace post unwind only if we regs and stack were captured

Bail out without error if we want to do backtrace post unwind, but were
not able to capture user registers or user stack during the record
phase, which is possible and valid case.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1347295819-23177-2-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
bdde3716 9ac3e487

+5
+5
tools/perf/util/session.c
··· 388 388 (evsel->attr.sample_type & PERF_SAMPLE_STACK_USER))) 389 389 return 0; 390 390 391 + /* Bail out if nothing was captured. */ 392 + if ((!sample->user_regs.regs) || 393 + (!sample->user_stack.size)) 394 + return 0; 395 + 391 396 return unwind__get_entries(unwind_entry, &callchain_cursor, machine, 392 397 thread, evsel->attr.sample_regs_user, 393 398 sample);