aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2009-04-06 22:01:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 11:31:08 -0400
commit8f9b15286a8ea49e997e845d02d357ed33ebd090 (patch)
treee6d2905679a938a92982ff48994f1623c6a87031
parentde5bd88d5a5cce3cacea904d3503e5ebdb3852a2 (diff)
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>
-rw-r--r--Documentation/kprobes.txt16
-rw-r--r--include/linux/kprobes.h17
2 files changed, 27 insertions, 6 deletions
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index f609af242d6c..1e7a769a10f9 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -365,21 +365,25 @@ probes) in the specified array, they clear the addr field of those
365incorrect probes. However, other probes in the array are 365incorrect probes. However, other probes in the array are
366unregistered correctly. 366unregistered correctly.
367 367
3684.7 disable_kprobe 3684.7 disable_*probe
369 369
370#include <linux/kprobes.h> 370#include <linux/kprobes.h>
371int disable_kprobe(struct kprobe *kp); 371int disable_kprobe(struct kprobe *kp);
372int disable_kretprobe(struct kretprobe *rp);
373int disable_jprobe(struct jprobe *jp);
372 374
373Temporarily disables the specified kprobe. You can enable it again by using 375Temporarily disables the specified *probe. You can enable it again by using
374enable_kprobe(). You must specify the kprobe which has been registered. 376enable_*probe(). You must specify the probe which has been registered.
375 377
3764.8 enable_kprobe 3784.8 enable_*probe
377 379
378#include <linux/kprobes.h> 380#include <linux/kprobes.h>
379int enable_kprobe(struct kprobe *kp); 381int enable_kprobe(struct kprobe *kp);
382int enable_kretprobe(struct kretprobe *rp);
383int enable_jprobe(struct jprobe *jp);
380 384
381Enables kprobe which has been disabled by disable_kprobe(). You must specify 385Enables *probe which has been disabled by disable_*probe(). You must specify
382the kprobe which has been registered. 386the probe which has been registered.
383 387
3845. Kprobes Features and Limitations 3885. Kprobes Features and Limitations
385 389
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 1071cfddddc9..bcd9c07848be 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -371,4 +371,21 @@ static inline int enable_kprobe(struct kprobe *kp)
371 return -ENOSYS; 371 return -ENOSYS;
372} 372}
373#endif /* CONFIG_KPROBES */ 373#endif /* CONFIG_KPROBES */
374static inline int disable_kretprobe(struct kretprobe *rp)
375{
376 return disable_kprobe(&rp->kp);
377}
378static inline int enable_kretprobe(struct kretprobe *rp)
379{
380 return enable_kprobe(&rp->kp);
381}
382static inline int disable_jprobe(struct jprobe *jp)
383{
384 return disable_kprobe(&jp->kp);
385}
386static inline int enable_jprobe(struct jprobe *jp)
387{
388 return enable_kprobe(&jp->kp);
389}
390
374#endif /* _LINUX_KPROBES_H */ 391#endif /* _LINUX_KPROBES_H */