On Tue, 9 Aug 2022 16:24:25 +0530, Naveen N. Rao wrote:
Extend commit b39181f7c6907d ("ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to
avoid adding weak function") to ppc32 and ppc64 -mprofile-kernel by
defining FTRACE_MCOUNT_MAX_OFFSET.
For ppc64 -mprofile-kernel ABI, we can have two instructions at function
entry for TOC setup followed by 'mflr r0' and 'bl _mcount'. So, the
mcount location is at most the 4th instruction in a function. For ppc32,
mcount location is always the 3rd instruction in a function, preceded by
'mflr r0' and 'stw r0,4(r1)'.
[...]
Applied to powerpc/next.
[1/1] powerpc/ftrace: Ignore weak functions
https://git.kernel.org/powerpc/c/7af82ff90a2b0690c2c45818fcce4c4ac3b187f3
cheers