aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kprobes.h
diff options
context:
space:
mode:
authorAnanth N Mavinakayanahalli <ananth@in.ibm.com>2008-01-30 07:32:53 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:53 -0500
commit8c1c9356429741a82ff176d0f3400fb9e06b2a30 (patch)
tree4daa7864163b77943e3d303c32a08672f443685e /include/linux/kprobes.h
parent3334052a321aca0ffecb54244d666311f98f5487 (diff)
x86: kprobes: add kprobes smoke tests that run on boot
Here is a quick and naive smoke test for kprobes. This is intended to just verify if some unrelated change broke the *probes subsystem. It is self contained, architecture agnostic and isn't of any great use by itself. This needs to be built in the kernel and runs a basic set of tests to verify if kprobes, jprobes and kretprobes run fine on the kernel. In case of an error, it'll print out a message with a "BUG" prefix. This is a start; we intend to add more tests to this bucket over time. Thanks to Jim Keniston and Masami Hiramatsu for comments and suggestions. Tested on x86 (32/64) and powerpc. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Acked-by: Masami Hiramatsu <mhiramat@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/kprobes.h')
-rw-r--r--include/linux/kprobes.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 81891581e89b..6168c0a44172 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -182,6 +182,15 @@ static inline void kretprobe_assert(struct kretprobe_instance *ri,
182 } 182 }
183} 183}
184 184
185#ifdef CONFIG_KPROBES_SANITY_TEST
186extern int init_test_probes(void);
187#else
188static inline int init_test_probes(void)
189{
190 return 0;
191}
192#endif /* CONFIG_KPROBES_SANITY_TEST */
193
185extern spinlock_t kretprobe_lock; 194extern spinlock_t kretprobe_lock;
186extern struct mutex kprobe_mutex; 195extern struct mutex kprobe_mutex;
187extern int arch_prepare_kprobe(struct kprobe *p); 196extern int arch_prepare_kprobe(struct kprobe *p);
@@ -227,6 +236,7 @@ void unregister_kretprobe(struct kretprobe *rp);
227 236
228void kprobe_flush_task(struct task_struct *tk); 237void kprobe_flush_task(struct task_struct *tk);
229void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); 238void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
239
230#else /* CONFIG_KPROBES */ 240#else /* CONFIG_KPROBES */
231 241
232#define __kprobes /**/ 242#define __kprobes /**/