aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kprobes.h
diff options
context:
space:
mode:
authorAnanth N Mavinakayanahalli <ananth@in.ibm.com>2005-11-07 04:00:13 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:53:46 -0500
commit3516a46042508a495fac13c2e73530d936ebe015 (patch)
tree2d03117832b5c2439987de73420a38fc3e5983e4 /include/linux/kprobes.h
parente7a510f92c1e482a7db05afd3cb84af1f4cfe0bc (diff)
[PATCH] Kprobes: Use RCU for (un)register synchronization - base changes
Changes to the base kprobes infrastructure to use RCU for synchronization during kprobe registration and unregistration. These changes coupled with the arch kprobe changes (next in series): a. serialize registration and unregistration of kprobes. b. enable lockless execution of handlers. Handlers can now run in parallel. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/kprobes.h')
-rw-r--r--include/linux/kprobes.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 6720305a31e8..cff281cf70cf 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -34,6 +34,8 @@
34#include <linux/notifier.h> 34#include <linux/notifier.h>
35#include <linux/smp.h> 35#include <linux/smp.h>
36#include <linux/percpu.h> 36#include <linux/percpu.h>
37#include <linux/spinlock.h>
38#include <linux/rcupdate.h>
37 39
38#include <asm/kprobes.h> 40#include <asm/kprobes.h>
39 41
@@ -146,10 +148,7 @@ struct kretprobe_instance {
146}; 148};
147 149
148#ifdef CONFIG_KPROBES 150#ifdef CONFIG_KPROBES
149/* Locks kprobe: irq must be disabled */ 151extern spinlock_t kretprobe_lock;
150void lock_kprobes(void);
151void unlock_kprobes(void);
152
153extern int arch_prepare_kprobe(struct kprobe *p); 152extern int arch_prepare_kprobe(struct kprobe *p);
154extern void arch_copy_kprobe(struct kprobe *p); 153extern void arch_copy_kprobe(struct kprobe *p);
155extern void arch_arm_kprobe(struct kprobe *p); 154extern void arch_arm_kprobe(struct kprobe *p);
@@ -160,7 +159,7 @@ extern void show_registers(struct pt_regs *regs);
160extern kprobe_opcode_t *get_insn_slot(void); 159extern kprobe_opcode_t *get_insn_slot(void);
161extern void free_insn_slot(kprobe_opcode_t *slot); 160extern void free_insn_slot(kprobe_opcode_t *slot);
162 161
163/* Get the kprobe at this addr (if any). Must have called lock_kprobes */ 162/* Get the kprobe at this addr (if any) - called under a rcu_read_lock() */
164struct kprobe *get_kprobe(void *addr); 163struct kprobe *get_kprobe(void *addr);
165struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); 164struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk);
166 165