diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-01-29 17:25:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-29 21:04:43 -0500 |
commit | dc19835df6c47ff676ad6c98722d5e529db5d74c (patch) | |
tree | 78e5eeb534e133cf487b96676883eaf176e993ef /include | |
parent | 252523ef2421b803de4810876223e4d695f23ec6 (diff) |
kprobes: fix module compilation error with CONFIG_KPROBES=n
Define kprobes related data structures even if CONFIG_KPROBES is not set.
This fixes compilation errors which occur if CONFIG_KPROBES is not set, in
kprobe using modules.
[akpm@linux-foundation.org: fix build for non-kprobes-supporting architectures]
Reviewed-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kprobes.h | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index d6ea19e314bb..32851eef48f0 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -49,6 +49,13 @@ | |||
49 | 49 | ||
50 | /* Attach to insert probes on any functions which should be ignored*/ | 50 | /* Attach to insert probes on any functions which should be ignored*/ |
51 | #define __kprobes __attribute__((__section__(".kprobes.text"))) notrace | 51 | #define __kprobes __attribute__((__section__(".kprobes.text"))) notrace |
52 | #else /* CONFIG_KPROBES */ | ||
53 | typedef int kprobe_opcode_t; | ||
54 | struct arch_specific_insn { | ||
55 | int dummy; | ||
56 | }; | ||
57 | #define __kprobes notrace | ||
58 | #endif /* CONFIG_KPROBES */ | ||
52 | 59 | ||
53 | struct kprobe; | 60 | struct kprobe; |
54 | struct pt_regs; | 61 | struct pt_regs; |
@@ -131,23 +138,6 @@ struct jprobe { | |||
131 | /* For backward compatibility with old code using JPROBE_ENTRY() */ | 138 | /* For backward compatibility with old code using JPROBE_ENTRY() */ |
132 | #define JPROBE_ENTRY(handler) (handler) | 139 | #define JPROBE_ENTRY(handler) (handler) |
133 | 140 | ||
134 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); | ||
135 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | ||
136 | |||
137 | #ifdef CONFIG_KRETPROBES | ||
138 | extern void arch_prepare_kretprobe(struct kretprobe_instance *ri, | ||
139 | struct pt_regs *regs); | ||
140 | extern int arch_trampoline_kprobe(struct kprobe *p); | ||
141 | #else /* CONFIG_KRETPROBES */ | ||
142 | static inline void arch_prepare_kretprobe(struct kretprobe *rp, | ||
143 | struct pt_regs *regs) | ||
144 | { | ||
145 | } | ||
146 | static inline int arch_trampoline_kprobe(struct kprobe *p) | ||
147 | { | ||
148 | return 0; | ||
149 | } | ||
150 | #endif /* CONFIG_KRETPROBES */ | ||
151 | /* | 141 | /* |
152 | * Function-return probe - | 142 | * Function-return probe - |
153 | * Note: | 143 | * Note: |
@@ -188,6 +178,25 @@ struct kprobe_blackpoint { | |||
188 | unsigned long range; | 178 | unsigned long range; |
189 | }; | 179 | }; |
190 | 180 | ||
181 | #ifdef CONFIG_KPROBES | ||
182 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); | ||
183 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | ||
184 | |||
185 | #ifdef CONFIG_KRETPROBES | ||
186 | extern void arch_prepare_kretprobe(struct kretprobe_instance *ri, | ||
187 | struct pt_regs *regs); | ||
188 | extern int arch_trampoline_kprobe(struct kprobe *p); | ||
189 | #else /* CONFIG_KRETPROBES */ | ||
190 | static inline void arch_prepare_kretprobe(struct kretprobe *rp, | ||
191 | struct pt_regs *regs) | ||
192 | { | ||
193 | } | ||
194 | static inline int arch_trampoline_kprobe(struct kprobe *p) | ||
195 | { | ||
196 | return 0; | ||
197 | } | ||
198 | #endif /* CONFIG_KRETPROBES */ | ||
199 | |||
191 | extern struct kretprobe_blackpoint kretprobe_blacklist[]; | 200 | extern struct kretprobe_blackpoint kretprobe_blacklist[]; |
192 | 201 | ||
193 | static inline void kretprobe_assert(struct kretprobe_instance *ri, | 202 | static inline void kretprobe_assert(struct kretprobe_instance *ri, |
@@ -264,10 +273,6 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); | |||
264 | 273 | ||
265 | #else /* CONFIG_KPROBES */ | 274 | #else /* CONFIG_KPROBES */ |
266 | 275 | ||
267 | #define __kprobes notrace | ||
268 | struct jprobe; | ||
269 | struct kretprobe; | ||
270 | |||
271 | static inline struct kprobe *get_kprobe(void *addr) | 276 | static inline struct kprobe *get_kprobe(void *addr) |
272 | { | 277 | { |
273 | return NULL; | 278 | return NULL; |