aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kprobes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kprobes.h')
-rw-r--r--include/linux/kprobes.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 04a3556bdea6..497b1d1f7a05 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -29,6 +29,7 @@
29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi 29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi
30 * <prasanna@in.ibm.com> added function-return probes. 30 * <prasanna@in.ibm.com> added function-return probes.
31 */ 31 */
32#include <linux/linkage.h>
32#include <linux/list.h> 33#include <linux/list.h>
33#include <linux/notifier.h> 34#include <linux/notifier.h>
34#include <linux/smp.h> 35#include <linux/smp.h>
@@ -47,7 +48,7 @@
47#define KPROBE_HIT_SSDONE 0x00000008 48#define KPROBE_HIT_SSDONE 0x00000008
48 49
49/* Attach to insert probes on any functions which should be ignored*/ 50/* Attach to insert probes on any functions which should be ignored*/
50#define __kprobes __attribute__((__section__(".kprobes.text"))) 51#define __kprobes __attribute__((__section__(".kprobes.text"))) notrace
51 52
52struct kprobe; 53struct kprobe;
53struct pt_regs; 54struct pt_regs;
@@ -157,11 +158,10 @@ struct kretprobe {
157 int nmissed; 158 int nmissed;
158 size_t data_size; 159 size_t data_size;
159 struct hlist_head free_instances; 160 struct hlist_head free_instances;
160 struct hlist_head used_instances; 161 spinlock_t lock;
161}; 162};
162 163
163struct kretprobe_instance { 164struct kretprobe_instance {
164 struct hlist_node uflist; /* either on free list or used list */
165 struct hlist_node hlist; 165 struct hlist_node hlist;
166 struct kretprobe *rp; 166 struct kretprobe *rp;
167 kprobe_opcode_t *ret_addr; 167 kprobe_opcode_t *ret_addr;
@@ -201,7 +201,6 @@ static inline int init_test_probes(void)
201} 201}
202#endif /* CONFIG_KPROBES_SANITY_TEST */ 202#endif /* CONFIG_KPROBES_SANITY_TEST */
203 203
204extern spinlock_t kretprobe_lock;
205extern struct mutex kprobe_mutex; 204extern struct mutex kprobe_mutex;
206extern int arch_prepare_kprobe(struct kprobe *p); 205extern int arch_prepare_kprobe(struct kprobe *p);
207extern void arch_arm_kprobe(struct kprobe *p); 206extern void arch_arm_kprobe(struct kprobe *p);
@@ -214,6 +213,9 @@ extern void kprobes_inc_nmissed_count(struct kprobe *p);
214 213
215/* Get the kprobe at this addr (if any) - called with preemption disabled */ 214/* Get the kprobe at this addr (if any) - called with preemption disabled */
216struct kprobe *get_kprobe(void *addr); 215struct kprobe *get_kprobe(void *addr);
216void kretprobe_hash_lock(struct task_struct *tsk,
217 struct hlist_head **head, unsigned long *flags);
218void kretprobe_hash_unlock(struct task_struct *tsk, unsigned long *flags);
217struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); 219struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk);
218 220
219/* kprobe_running() will just return the current_kprobe on this CPU */ 221/* kprobe_running() will just return the current_kprobe on this CPU */
@@ -255,7 +257,7 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
255 257
256#else /* CONFIG_KPROBES */ 258#else /* CONFIG_KPROBES */
257 259
258#define __kprobes /**/ 260#define __kprobes notrace
259struct jprobe; 261struct jprobe;
260struct kretprobe; 262struct kretprobe;
261 263