Re: [PATCH v3] ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak functions

From: Steven Rostedt
Date: Thu May 26 2022 - 10:44:45 EST


On Thu, 26 May 2022 10:38:10 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> +++ b/arch/x86/include/asm/ftrace.h
> @@ -9,6 +9,11 @@
> # define MCOUNT_ADDR ((unsigned long)(__fentry__))
> #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
>
> +/* Ignore unused weak functions which will have non zero offsets */
> +#ifdef CONFIG_HAVE_FENTRY
> +# define FTRACE_MCOUNT_MAX_OFFSET 0
> +#endif
> +

I screwed up this patch. Please ignore.

And Peter just informed me that IBT is in 5.18 already, and not 5.19. So,
I'll add his suggestion in v4.

-- Steve