@@ -288,6 +288,8 @@ extern const unsigned char *arch_kprobe_on_ftrace_get_old_insn(struct kprobe *kp
const unsigned char *ftrace_nop, unsigned char *dest, size_t insn_size);
extern void init_kprobes_on_ftrace(void);
+extern bool kprobes_on_ftrace_initialized __read_mostly;
+
extern bool kprobe_fix_ftrace_make_nop(struct dyn_ftrace *rec);
extern const unsigned char *kprobe_on_ftrace_get_old_insn(struct dyn_ftrace *rec,
const unsigned char *ftrace_nop, unsigned char *dest, size_t insn_size);
@@ -295,6 +297,7 @@ extern const unsigned char *kprobe_on_ftrace_get_old_insn(struct dyn_ftrace *rec
static inline void init_kprobes_on_ftrace(void)
{
}
+#define kprobes_on_ftrace_initialized true
static inline bool kprobe_fix_ftrace_make_nop(struct dyn_ftrace *_unused)
{
@@ -70,9 +70,7 @@
static int kprobes_initialized;
static int kprobes_blacklist_initialized;
#if defined(CONFIG_KPROBES_ON_FTRACE) && defined(CONFIG_EARLY_KPROBES)
-static bool kprobes_on_ftrace_initialized __read_mostly = false;
-#else
-# define kprobes_on_ftrace_initialized false
+bool kprobes_on_ftrace_initialized __read_mostly = false;
#endif
bool kprobes_is_early(void)
That var is useful for x86 recover_probed_instruction() for recovering ftraced instructions, to make it possible to determine whether the instruction has been converted to nop by ftrace. I will merge this patch into next version of early kprobe series. Signed-off-by: Wang Nan <wangnan0@huawei.com> --- include/linux/kprobes.h | 3 +++ kernel/kprobes.c | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-)