X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Flinux%2Fftrace.h;h=bb384068272e1ef5ef9f4aa4a04572e48dcbfca5;hb=4c0e799a9a6dc64426ddb6c03aea1a154357658f;hp=f368d041e02d1f41ccb36bda3a4c5da59c65df3d;hpb=0c17e4ceedd35c78b1c7413dbd16279a350be6bc;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index f368d041e02..bb384068272 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -98,6 +98,27 @@ static inline void tracer_disable(void) #endif } +/* Ftrace disable/restore without lock. Some synchronization mechanism + * must be used to prevent ftrace_enabled to be changed between + * disable/restore. */ +static inline int __ftrace_enabled_save(void) +{ +#ifdef CONFIG_FTRACE + int saved_ftrace_enabled = ftrace_enabled; + ftrace_enabled = 0; + return saved_ftrace_enabled; +#else + return 0; +#endif +} + +static inline void __ftrace_enabled_restore(int enabled) +{ +#ifdef CONFIG_FTRACE + ftrace_enabled = enabled; +#endif +} + #ifdef CONFIG_FRAME_POINTER /* TODO: need to fix this for ARM */ # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))