Skip to content

Commit 93b3cca

Browse files
committed
ftrace: Make all inline tags also include notrace
Commit 5963e31 ("ftrace/x86: Do not change stacks in DEBUG when calling lockdep") prevented lockdep calls from the int3 breakpoint handler from reseting the stack if a function that was called was in the process of being converted for tracing and had a breakpoint on it. The idea is, before calling the lockdep code, do a load_idt() to the special IDT that kept the breakpoint stack from reseting. This worked well as a quick fix for this kernel release, until a certain config caused a lockup in the function tracer start up tests. Investigating it, I found that the load_idt that was used to prevent the int3 from changing stacks was itself being traced! Even though the config had CONFIG_OPTIMIZE_INLINING disabled, and all 'inline' tags were set to always inline, there were still cases that it did not inline! This was caused by CONFIG_PARAVIRT_GUEST, where it would add a pointer to the native_load_idt() which made that function to be traced. Commit 45959ee ("ftrace: Do not function trace inlined functions") only touched the 'inline' tags when CONFIG_OPMITIZE_INLINING was enabled. PARAVIRT_GUEST shows that this was not enough and we need to also mark always_inline with notrace as well. Reported-by: Fengguang Wu <[email protected]> Tested-by: Fengguang Wu <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent a702704 commit 93b3cca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/linux/compiler-gcc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
*/
4848
#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
4949
!defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
50-
# define inline inline __attribute__((always_inline))
51-
# define __inline__ __inline__ __attribute__((always_inline))
52-
# define __inline __inline __attribute__((always_inline))
50+
# define inline inline __attribute__((always_inline)) notrace
51+
# define __inline__ __inline__ __attribute__((always_inline)) notrace
52+
# define __inline __inline __attribute__((always_inline)) notrace
5353
#else
5454
/* A lot of inline functions can cause havoc with function tracing */
5555
# define inline inline notrace

0 commit comments

Comments
 (0)