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.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 39826a678364..1071cfddddc9 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -112,18 +112,28 @@ struct kprobe {
112 /* copy of the original instruction */ 112 /* copy of the original instruction */
113 struct arch_specific_insn ainsn; 113 struct arch_specific_insn ainsn;
114 114
115 /* Indicates various status flags. Protected by kprobe_mutex. */ 115 /*
116 * Indicates various status flags.
117 * Protected by kprobe_mutex after this kprobe is registered.
118 */
116 u32 flags; 119 u32 flags;
117}; 120};
118 121
119/* Kprobe status flags */ 122/* Kprobe status flags */
120#define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */ 123#define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */
124#define KPROBE_FLAG_DISABLED 2 /* probe is temporarily disabled */
121 125
126/* Has this kprobe gone ? */
122static inline int kprobe_gone(struct kprobe *p) 127static inline int kprobe_gone(struct kprobe *p)
123{ 128{
124 return p->flags & KPROBE_FLAG_GONE; 129 return p->flags & KPROBE_FLAG_GONE;
125} 130}
126 131
132/* Is this kprobe disabled ? */
133static inline int kprobe_disabled(struct kprobe *p)
134{
135 return p->flags & (KPROBE_FLAG_DISABLED | KPROBE_FLAG_GONE);
136}
127/* 137/*
128 * Special probe type that uses setjmp-longjmp type tricks to resume 138 * Special probe type that uses setjmp-longjmp type tricks to resume
129 * execution at a specified entry with a matching prototype corresponding 139 * execution at a specified entry with a matching prototype corresponding
@@ -283,6 +293,9 @@ void unregister_kretprobes(struct kretprobe **rps, int num);
283void kprobe_flush_task(struct task_struct *tk); 293void kprobe_flush_task(struct task_struct *tk);
284void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); 294void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
285 295
296int disable_kprobe(struct kprobe *kp);
297int enable_kprobe(struct kprobe *kp);
298
286#else /* !CONFIG_KPROBES: */ 299#else /* !CONFIG_KPROBES: */
287 300
288static inline int kprobes_built_in(void) 301static inline int kprobes_built_in(void)
@@ -349,5 +362,13 @@ static inline void unregister_kretprobes(struct kretprobe **rps, int num)
349static inline void kprobe_flush_task(struct task_struct *tk) 362static inline void kprobe_flush_task(struct task_struct *tk)
350{ 363{
351} 364}
365static inline int disable_kprobe(struct kprobe *kp)
366{
367 return -ENOSYS;
368}
369static inline int enable_kprobe(struct kprobe *kp)
370{
371 return -ENOSYS;
372}
352#endif /* CONFIG_KPROBES */ 373#endif /* CONFIG_KPROBES */
353#endif /* _LINUX_KPROBES_H */ 374#endif /* _LINUX_KPROBES_H */