Skip to content

Commit

Permalink
kprobes: Disable the jprobes APIs
Browse files Browse the repository at this point in the history
Disable the jprobes APIs and comment out the jprobes API function
code. This is in preparation of removing all jprobes related
code (including kprobe's break_handler).

Nowadays ftrace and other tracing features are mature enough
to replace jprobes use-cases. Users can safely use ftrace and
perf probe etc. for their use cases.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: David S . Miller <davem@davemloft.net>
Cc: Ian McDonald <ian.mcdonald@jandi.co.nz>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E . McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Link: http://lkml.kernel.org/r/150724527741.5014.15465541485637899227.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
mhiramat authored and Ingo Molnar committed Oct 20, 2017
1 parent ca4b9c3 commit 590c845
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
40 changes: 18 additions & 22 deletions include/linux/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,6 @@ int register_kprobes(struct kprobe **kps, int num);
void unregister_kprobes(struct kprobe **kps, int num);
int setjmp_pre_handler(struct kprobe *, struct pt_regs *);
int longjmp_break_handler(struct kprobe *, struct pt_regs *);
int register_jprobe(struct jprobe *p);
void unregister_jprobe(struct jprobe *p);
int register_jprobes(struct jprobe **jps, int num);
void unregister_jprobes(struct jprobe **jps, int num);
void jprobe_return(void);
unsigned long arch_deref_entry_point(void *);

Expand Down Expand Up @@ -443,20 +439,6 @@ static inline void unregister_kprobe(struct kprobe *p)
static inline void unregister_kprobes(struct kprobe **kps, int num)
{
}
static inline int register_jprobe(struct jprobe *p)
{
return -ENOSYS;
}
static inline int register_jprobes(struct jprobe **jps, int num)
{
return -ENOSYS;
}
static inline void unregister_jprobe(struct jprobe *p)
{
}
static inline void unregister_jprobes(struct jprobe **jps, int num)
{
}
static inline void jprobe_return(void)
{
}
Expand Down Expand Up @@ -486,6 +468,20 @@ static inline int enable_kprobe(struct kprobe *kp)
return -ENOSYS;
}
#endif /* CONFIG_KPROBES */
static inline int __deprecated register_jprobe(struct jprobe *p)
{
return -ENOSYS;
}
static inline int __deprecated register_jprobes(struct jprobe **jps, int num)
{
return -ENOSYS;
}
static inline void __deprecated unregister_jprobe(struct jprobe *p)
{
}
static inline void __deprecated unregister_jprobes(struct jprobe **jps, int num)
{
}
static inline int disable_kretprobe(struct kretprobe *rp)
{
return disable_kprobe(&rp->kp);
Expand All @@ -494,13 +490,13 @@ static inline int enable_kretprobe(struct kretprobe *rp)
{
return enable_kprobe(&rp->kp);
}
static inline int disable_jprobe(struct jprobe *jp)
static inline int __deprecated disable_jprobe(struct jprobe *jp)
{
return disable_kprobe(&jp->kp);
return -ENOSYS;
}
static inline int enable_jprobe(struct jprobe *jp)
static inline int __deprecated enable_jprobe(struct jprobe *jp)
{
return enable_kprobe(&jp->kp);
return -ENOSYS;
}

#ifndef CONFIG_KPROBES
Expand Down
2 changes: 2 additions & 0 deletions kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,7 @@ unsigned long __weak arch_deref_entry_point(void *entry)
return (unsigned long)entry;
}

#if 0
int register_jprobes(struct jprobe **jps, int num)
{
int ret = 0, i;
Expand Down Expand Up @@ -1839,6 +1840,7 @@ void unregister_jprobes(struct jprobe **jps, int num)
}
}
EXPORT_SYMBOL_GPL(unregister_jprobes);
#endif

#ifdef CONFIG_KRETPROBES
/*
Expand Down

0 comments on commit 590c845

Please sign in to comment.