Messages in this thread | | | Date | Thu, 26 May 2022 10:05:30 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH v3] ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak functions |
| |
On Thu, 26 May 2022 10:38:10 -0400 Steven Rostedt <rostedt@goodmis.org> wrote:
> If an unused weak function was traced, it's call to fentry will still > exist, which gets added into the __mcount_loc table. Ftrace will use > kallsyms to retrieve the name for each location in __mcount_loc to display > it in the available_filter_functions and used to enable functions via the > name matching in set_ftrace_filter/notrace. Enabling these functions do > nothing but enable an unused call to ftrace_caller. If a traced weak > function is overridden, the symbol of the function would be used for it, > which will either created duplicate names, or if the previous function was > not traced, it would be incorrectly listed in available_filter_functions > as a function that can be traced.
This might be dependent on binutils version. In some situations the unused __weak function might be dropped altogether. This change (https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1) tripped up recordmcount (https://lore.kernel.org/all/20220518181828.645877-1-naveen.n.rao@linux.vnet.ibm.com/T/#u).
The kexec fix will be to just give up on using __weak.
| |