diff options
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index f368d041e02d..bb384068272e 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -98,6 +98,27 @@ static inline void tracer_disable(void) | |||
98 | #endif | 98 | #endif |
99 | } | 99 | } |
100 | 100 | ||
101 | /* Ftrace disable/restore without lock. Some synchronization mechanism | ||
102 | * must be used to prevent ftrace_enabled to be changed between | ||
103 | * disable/restore. */ | ||
104 | static inline int __ftrace_enabled_save(void) | ||
105 | { | ||
106 | #ifdef CONFIG_FTRACE | ||
107 | int saved_ftrace_enabled = ftrace_enabled; | ||
108 | ftrace_enabled = 0; | ||
109 | return saved_ftrace_enabled; | ||
110 | #else | ||
111 | return 0; | ||
112 | #endif | ||
113 | } | ||
114 | |||
115 | static inline void __ftrace_enabled_restore(int enabled) | ||
116 | { | ||
117 | #ifdef CONFIG_FTRACE | ||
118 | ftrace_enabled = enabled; | ||
119 | #endif | ||
120 | } | ||
121 | |||
101 | #ifdef CONFIG_FRAME_POINTER | 122 | #ifdef CONFIG_FRAME_POINTER |
102 | /* TODO: need to fix this for ARM */ | 123 | /* TODO: need to fix this for ARM */ |
103 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | 124 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) |