[PATCH RESEND v3 1/2] ftrace: cleanup ftrace_graph_caller enable and disable

Steven Rostedt rostedt at goodmis.org
Sat Apr 9 07:23:00 PDT 2022


On Sat,  9 Apr 2022 16:54:59 +0800
Chengming Zhou <zhouchengming at 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;




More information about the linux-arm-kernel mailing list