--- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2403,7 +2403,7 @@ static int thread__resolve_callchain_sam } check_calls: - if (callchain_param.order != ORDER_CALLEE) { + if (chain && callchain_param.order != ORDER_CALLEE) { err = find_prev_cpumode(chain, thread, cursor, parent, root_al, &cpumode, chain->nr - first_call); if (err)