lkml.org 
[lkml]   [2020]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] perf/core: allow ftrace for functions in kernel/event/core.c
Date


> On May 26, 2020, at 10:40 PM, Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> On Tue, 26 May 2020 21:46:29 +0000
> Song Liu <songliubraving@fb.com> wrote:
>
>>
>>
>>> On May 26, 2020, at 2:39 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>>>
>>> On Tue, May 26, 2020 at 02:28:26PM -0700, Song Liu wrote:
>>>> It is useful to trace functions in kernel/event/core.c. Allow ftrace for
>>>> them by removing $(CC_FLAGS_FTRACE) from Makefile.
>>>
>>> Did you try using the ftrace event with perf with this on?
>>
>> I have tried a few things, like
>>
>> perf stat -e probe:perf_read -I 1000
>> perf record -e probe:__x64_sys_perf_event_open -aR
>>
>> They all work fine.
>
> Did you try using perf with function-tracer or function-graph tracer?
> If you just want to trace those functions with kprobes, you can
> build your kernel with CONFIG_KPROBE_EVENTS_ON_NOTRACE=y, which allows
> you to probe perf_read etc.

Thanks for the hint.

kprobe does work with CONFIG_KPROBE_EVENTS_ON_NOTRACE, but BPF trampoline
doesn't work. If it is safe, removing $(CC_FLAGS_FTRACE) is preferable.

Thanks,
Song

\
 
 \ /
  Last update: 2020-05-27 21:46    [W:0.204 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site