Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kprobes: support kretprobe and jprobe per-probe disabling

Add disable/enable_kretprobe() and disable/enable_jprobe().

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Masami Hiramatsu and committed by
Linus Torvalds
8f9b1528 de5bd88d

+27 -6
+10 -6
Documentation/kprobes.txt
··· 365 365 incorrect probes. However, other probes in the array are 366 366 unregistered correctly. 367 367 368 - 4.7 disable_kprobe 368 + 4.7 disable_*probe 369 369 370 370 #include <linux/kprobes.h> 371 371 int disable_kprobe(struct kprobe *kp); 372 + int disable_kretprobe(struct kretprobe *rp); 373 + int disable_jprobe(struct jprobe *jp); 372 374 373 - Temporarily disables the specified kprobe. You can enable it again by using 374 - enable_kprobe(). You must specify the kprobe which has been registered. 375 + Temporarily disables the specified *probe. You can enable it again by using 376 + enable_*probe(). You must specify the probe which has been registered. 375 377 376 - 4.8 enable_kprobe 378 + 4.8 enable_*probe 377 379 378 380 #include <linux/kprobes.h> 379 381 int enable_kprobe(struct kprobe *kp); 382 + int enable_kretprobe(struct kretprobe *rp); 383 + int enable_jprobe(struct jprobe *jp); 380 384 381 - Enables kprobe which has been disabled by disable_kprobe(). You must specify 382 - the kprobe which has been registered. 385 + Enables *probe which has been disabled by disable_*probe(). You must specify 386 + the probe which has been registered. 383 387 384 388 5. Kprobes Features and Limitations 385 389
+17
include/linux/kprobes.h
··· 371 371 return -ENOSYS; 372 372 } 373 373 #endif /* CONFIG_KPROBES */ 374 + static inline int disable_kretprobe(struct kretprobe *rp) 375 + { 376 + return disable_kprobe(&rp->kp); 377 + } 378 + static inline int enable_kretprobe(struct kretprobe *rp) 379 + { 380 + return enable_kprobe(&rp->kp); 381 + } 382 + static inline int disable_jprobe(struct jprobe *jp) 383 + { 384 + return disable_kprobe(&jp->kp); 385 + } 386 + static inline int enable_jprobe(struct jprobe *jp) 387 + { 388 + return enable_kprobe(&jp->kp); 389 + } 390 + 374 391 #endif /* _LINUX_KPROBES_H */