diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-12 04:17:09 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-12 04:17:09 -0500 |
commit | 60a011c736e7dd09a0b01ca6a051a416f3f52ffb (patch) | |
tree | 20e91db58c3bbfa622d3ed8ec747e4974a807284 /kernel/trace/trace.h | |
parent | d06bbd669539215405874d8fe32ab65105e6c4bb (diff) | |
parent | 19b3e9671c5a219b8c34da2cc66e0ce7c3a501ae (diff) |
Merge branch 'tracing/function-return-tracer' into tracing/fastboot
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 978145088fb8..e40ce0c14690 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -22,6 +22,7 @@ enum trace_type { | |||
22 | TRACE_MMIO_RW, | 22 | TRACE_MMIO_RW, |
23 | TRACE_MMIO_MAP, | 23 | TRACE_MMIO_MAP, |
24 | TRACE_BOOT, | 24 | TRACE_BOOT, |
25 | TRACE_FN_RET, | ||
25 | 26 | ||
26 | __TRACE_LAST_TYPE | 27 | __TRACE_LAST_TYPE |
27 | }; | 28 | }; |
@@ -48,6 +49,15 @@ struct ftrace_entry { | |||
48 | unsigned long ip; | 49 | unsigned long ip; |
49 | unsigned long parent_ip; | 50 | unsigned long parent_ip; |
50 | }; | 51 | }; |
52 | |||
53 | /* Function return entry */ | ||
54 | struct ftrace_ret_entry { | ||
55 | struct trace_entry ent; | ||
56 | unsigned long ip; | ||
57 | unsigned long parent_ip; | ||
58 | unsigned long long calltime; | ||
59 | unsigned long long rettime; | ||
60 | }; | ||
51 | extern struct tracer boot_tracer; | 61 | extern struct tracer boot_tracer; |
52 | 62 | ||
53 | /* | 63 | /* |
@@ -218,6 +228,7 @@ extern void __ftrace_bad_type(void); | |||
218 | IF_ASSIGN(var, ent, struct trace_mmiotrace_map, \ | 228 | IF_ASSIGN(var, ent, struct trace_mmiotrace_map, \ |
219 | TRACE_MMIO_MAP); \ | 229 | TRACE_MMIO_MAP); \ |
220 | IF_ASSIGN(var, ent, struct trace_boot, TRACE_BOOT); \ | 230 | IF_ASSIGN(var, ent, struct trace_boot, TRACE_BOOT); \ |
231 | IF_ASSIGN(var, ent, struct ftrace_ret_entry, TRACE_FN_RET); \ | ||
221 | __ftrace_bad_type(); \ | 232 | __ftrace_bad_type(); \ |
222 | } while (0) | 233 | } while (0) |
223 | 234 | ||
@@ -321,6 +332,8 @@ void trace_function(struct trace_array *tr, | |||
321 | unsigned long ip, | 332 | unsigned long ip, |
322 | unsigned long parent_ip, | 333 | unsigned long parent_ip, |
323 | unsigned long flags, int pc); | 334 | unsigned long flags, int pc); |
335 | void | ||
336 | trace_function_return(struct ftrace_retfunc *trace); | ||
324 | 337 | ||
325 | void tracing_start_cmdline_record(void); | 338 | void tracing_start_cmdline_record(void); |
326 | void tracing_stop_cmdline_record(void); | 339 | void tracing_stop_cmdline_record(void); |
@@ -393,6 +406,10 @@ extern void *head_page(struct trace_array_cpu *data); | |||
393 | extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...); | 406 | extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...); |
394 | extern void trace_seq_print_cont(struct trace_seq *s, | 407 | extern void trace_seq_print_cont(struct trace_seq *s, |
395 | struct trace_iterator *iter); | 408 | struct trace_iterator *iter); |
409 | |||
410 | extern int | ||
411 | seq_print_ip_sym(struct trace_seq *s, unsigned long ip, | ||
412 | unsigned long sym_flags); | ||
396 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 413 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
397 | size_t cnt); | 414 | size_t cnt); |
398 | extern long ns2usecs(cycle_t nsec); | 415 | extern long ns2usecs(cycle_t nsec); |
@@ -400,6 +417,17 @@ extern int trace_vprintk(unsigned long ip, const char *fmt, va_list args); | |||
400 | 417 | ||
401 | extern unsigned long trace_flags; | 418 | extern unsigned long trace_flags; |
402 | 419 | ||
420 | /* Standard output formatting function used for function return traces */ | ||
421 | #ifdef CONFIG_FUNCTION_RET_TRACER | ||
422 | extern enum print_line_t print_return_function(struct trace_iterator *iter); | ||
423 | #else | ||
424 | static inline enum print_line_t | ||
425 | print_return_function(struct trace_iterator *iter) | ||
426 | { | ||
427 | return TRACE_TYPE_UNHANDLED; | ||
428 | } | ||
429 | #endif | ||
430 | |||
403 | /* | 431 | /* |
404 | * trace_iterator_flags is an enumeration that defines bit | 432 | * trace_iterator_flags is an enumeration that defines bit |
405 | * positions into trace_flags that controls the output. | 433 | * positions into trace_flags that controls the output. |
@@ -422,6 +450,13 @@ enum trace_iterator_flags { | |||
422 | TRACE_ITER_PREEMPTONLY = 0x800, | 450 | TRACE_ITER_PREEMPTONLY = 0x800, |
423 | }; | 451 | }; |
424 | 452 | ||
453 | /* | ||
454 | * TRACE_ITER_SYM_MASK masks the options in trace_flags that | ||
455 | * control the output of kernel symbols. | ||
456 | */ | ||
457 | #define TRACE_ITER_SYM_MASK \ | ||
458 | (TRACE_ITER_PRINT_PARENT|TRACE_ITER_SYM_OFFSET|TRACE_ITER_SYM_ADDR) | ||
459 | |||
425 | extern struct tracer nop_trace; | 460 | extern struct tracer nop_trace; |
426 | 461 | ||
427 | /** | 462 | /** |