[lkml]   [2019]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectGetting empty callchain from perf_callchain_kernel()

We found a failure with selftests/bpf/tests_prog in test_stacktrace_map (on bpf/master

After digging into the code, we found that perf_callchain_kernel() is giving empty
callchain for tracepoint sched/sched_switch. And it seems related to commit

("perf/x86: Make perf callchains work without CONFIG_FRAME_POINTER")

Before this commit, perf_callchain_kernel() returns callchain with regs->ip. With
this commit, regs->ip is not sent for !perf_hw_regs(regs) case.

I found the following change fixes the selftest. But I am not very sure, it is
the best solution here.

Please share comments and suggestions on this.

Thanks in advance!


diff --git i/arch/x86/events/core.c w/arch/x86/events/core.c
index f315425d8468..7b8a9eb4d5fd 100644
--- i/arch/x86/events/core.c
+++ w/arch/x86/events/core.c
@@ -2402,9 +2402,9 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re

+ if (perf_callchain_store(entry, regs->ip))
+ return;
if (perf_hw_regs(regs)) {
- if (perf_callchain_store(entry, regs->ip))
- return;
unwind_start(&state, current, regs, NULL);
} else {
unwind_start(&state, current, NULL, (void *)regs->sp);

 \ /
  Last update: 2019-05-17 01:53    [W:0.143 / U:3.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site