diff options
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 654fd657bd03..667f832d16b7 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -38,6 +38,8 @@ enum trace_type { | |||
38 | TRACE_KMEM_FREE, | 38 | TRACE_KMEM_FREE, |
39 | TRACE_POWER, | 39 | TRACE_POWER, |
40 | TRACE_BLK, | 40 | TRACE_BLK, |
41 | TRACE_KPROBE, | ||
42 | TRACE_KRETPROBE, | ||
41 | 43 | ||
42 | __TRACE_LAST_TYPE, | 44 | __TRACE_LAST_TYPE, |
43 | }; | 45 | }; |
@@ -205,6 +207,30 @@ struct syscall_trace_exit { | |||
205 | unsigned long ret; | 207 | unsigned long ret; |
206 | }; | 208 | }; |
207 | 209 | ||
210 | struct kprobe_trace_entry { | ||
211 | struct trace_entry ent; | ||
212 | unsigned long ip; | ||
213 | int nargs; | ||
214 | unsigned long args[]; | ||
215 | }; | ||
216 | |||
217 | #define SIZEOF_KPROBE_TRACE_ENTRY(n) \ | ||
218 | (offsetof(struct kprobe_trace_entry, args) + \ | ||
219 | (sizeof(unsigned long) * (n))) | ||
220 | |||
221 | struct kretprobe_trace_entry { | ||
222 | struct trace_entry ent; | ||
223 | unsigned long func; | ||
224 | unsigned long ret_ip; | ||
225 | int nargs; | ||
226 | unsigned long args[]; | ||
227 | }; | ||
228 | |||
229 | #define SIZEOF_KRETPROBE_TRACE_ENTRY(n) \ | ||
230 | (offsetof(struct kretprobe_trace_entry, args) + \ | ||
231 | (sizeof(unsigned long) * (n))) | ||
232 | |||
233 | |||
208 | 234 | ||
209 | /* | 235 | /* |
210 | * trace_flag_type is an enumeration that holds different | 236 | * trace_flag_type is an enumeration that holds different |
@@ -317,6 +343,10 @@ extern void __ftrace_bad_type(void); | |||
317 | TRACE_KMEM_ALLOC); \ | 343 | TRACE_KMEM_ALLOC); \ |
318 | IF_ASSIGN(var, ent, struct kmemtrace_free_entry, \ | 344 | IF_ASSIGN(var, ent, struct kmemtrace_free_entry, \ |
319 | TRACE_KMEM_FREE); \ | 345 | TRACE_KMEM_FREE); \ |
346 | IF_ASSIGN(var, ent, struct kprobe_trace_entry, \ | ||
347 | TRACE_KPROBE); \ | ||
348 | IF_ASSIGN(var, ent, struct kretprobe_trace_entry, \ | ||
349 | TRACE_KRETPROBE); \ | ||
320 | __ftrace_bad_type(); \ | 350 | __ftrace_bad_type(); \ |
321 | } while (0) | 351 | } while (0) |
322 | 352 | ||