lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 16 May 2019 23:51:55 +0000
From:   Song Liu <>
To:     "" <>,
        lkml <>
CC:     Peter Zijlstra <>,
        Kernel Team <>
Subject: Getting 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);

Powered by blists - more mailing lists