diff options
author | Ananth N Mavinakayanahalli <ananth@in.ibm.com> | 2007-05-08 03:34:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:19 -0400 |
commit | bf8f6e5b3e51ee0c64c2d1350c70198ddc8ad3f7 (patch) | |
tree | c48ebb92f836cfac58465eacc9658fbc2bac4783 /include/linux | |
parent | 4c4308cb93450989846ac49faeb6dab943e7657e (diff) |
Kprobes: The ON/OFF knob thru debugfs
This patch provides a debugfs knob to turn kprobes on/off
o A new file /debug/kprobes/enabled indicates if kprobes is enabled or
not (default enabled)
o Echoing 0 to this file will disarm all installed probes
o Any new probe registration when disabled will register the probe but
not arm it. A message will be printed out in such a case.
o When a value 1 is echoed to the file, all probes (including ones
registered in the intervening period) will be enabled
o Unregistration will happen irrespective of whether probes are globally
enabled or not.
o Update Documentation/kprobes.txt to reflect these changes. While there
also update the doc to make it current.
We are also looking at providing sysrq key support to tie to the disabling
feature provided by this patch.
[akpm@linux-foundation.org: Use bool like a bool!]
[akpm@linux-foundation.org: add printk facility levels]
[cornelia.huck@de.ibm.com: Add the missing arch_trampoline_kprobe() for s390]
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/kprobes.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 6fc623e41fd8..23adf6075ae4 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -125,11 +125,16 @@ DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | |||
125 | #ifdef ARCH_SUPPORTS_KRETPROBES | 125 | #ifdef ARCH_SUPPORTS_KRETPROBES |
126 | extern void arch_prepare_kretprobe(struct kretprobe_instance *ri, | 126 | extern void arch_prepare_kretprobe(struct kretprobe_instance *ri, |
127 | struct pt_regs *regs); | 127 | struct pt_regs *regs); |
128 | extern int arch_trampoline_kprobe(struct kprobe *p); | ||
128 | #else /* ARCH_SUPPORTS_KRETPROBES */ | 129 | #else /* ARCH_SUPPORTS_KRETPROBES */ |
129 | static inline void arch_prepare_kretprobe(struct kretprobe *rp, | 130 | static inline void arch_prepare_kretprobe(struct kretprobe *rp, |
130 | struct pt_regs *regs) | 131 | struct pt_regs *regs) |
131 | { | 132 | { |
132 | } | 133 | } |
134 | static inline int arch_trampoline_kprobe(struct kprobe *p) | ||
135 | { | ||
136 | return 0; | ||
137 | } | ||
133 | #endif /* ARCH_SUPPORTS_KRETPROBES */ | 138 | #endif /* ARCH_SUPPORTS_KRETPROBES */ |
134 | /* | 139 | /* |
135 | * Function-return probe - | 140 | * Function-return probe - |