lkml.org 
[lkml]   [2022]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RESEND v3 1/2] ftrace: cleanup ftrace_graph_caller enable and disable
On Sat,  9 Apr 2022 16:54:59 +0800
Chengming Zhou <zhouchengming@bytedance.com> wrote:

> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -2721,6 +2721,26 @@ int __weak ftrace_arch_code_modify_post_process(void)
> return 0;
> }
>
> +#ifdef CONFIG_FUNCTION_GRAPH_TRACER

Actually, can you put this into fgraph.c instead. That only gets compiled
if the above config is enabled. Thus, you do not even need to add the
#ifdef around it.

I intend to move even more code into fgraph.c that is only for function
graph. I don't want to add any new code to ftrace.c for it.

-- Steve


> +/*
> + * archs can override this function if they must do something
> + * to enable hook for graph tracer.
> + */
> +int __weak ftrace_enable_ftrace_graph_caller(void)
> +{
> + return 0;
> +}
> +
> +/*
> + * archs can override this function if they must do something
> + * to disable hook for graph tracer.
> + */
> +int __weak ftrace_disable_ftrace_graph_caller(void)
> +{
> + return 0;
> +}
> +#endif
> +
> void ftrace_modify_all_code(int command)
> {
> int update = command & FTRACE_UPDATE_TRACE_FUNC;

\
 
 \ /
  Last update: 2022-04-09 16:23    [W:0.057 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site