Commit effb83cc authored by Ilya Leoshkevich's avatar Ilya Leoshkevich Committed by Vasily Gorbik
Browse files

s390: add error handling to perf_callchain_kernel



perf_callchain_kernel stops neither when it encounters a garbage
address, nor when it runs out of space. Fix both issues using x86
version as an inspiration.

Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 265f79dc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -224,9 +224,13 @@ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
			   struct pt_regs *regs)
{
	struct unwind_state state;
	unsigned long addr;

	unwind_for_each_frame(&state, current, regs, 0)
		perf_callchain_store(entry, state.ip);
	unwind_for_each_frame(&state, current, regs, 0) {
		addr = unwind_get_return_address(&state);
		if (!addr || perf_callchain_store(entry, addr))
			return;
	}
}

/* Perf definitions for PMU event attributes in sysfs */