aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-12 04:17:09 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-12 04:17:09 -0500
commit60a011c736e7dd09a0b01ca6a051a416f3f52ffb (patch)
tree20e91db58c3bbfa622d3ed8ec747e4974a807284 /kernel/trace/trace.h
parentd06bbd669539215405874d8fe32ab65105e6c4bb (diff)
parent19b3e9671c5a219b8c34da2cc66e0ce7c3a501ae (diff)
Merge branch 'tracing/function-return-tracer' into tracing/fastboot
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h35
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 */
54struct 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};
51extern struct tracer boot_tracer; 61extern 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);
335void
336trace_function_return(struct ftrace_retfunc *trace);
324 337
325void tracing_start_cmdline_record(void); 338void tracing_start_cmdline_record(void);
326void tracing_stop_cmdline_record(void); 339void tracing_stop_cmdline_record(void);
@@ -393,6 +406,10 @@ extern void *head_page(struct trace_array_cpu *data);
393extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...); 406extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...);
394extern void trace_seq_print_cont(struct trace_seq *s, 407extern void trace_seq_print_cont(struct trace_seq *s,
395 struct trace_iterator *iter); 408 struct trace_iterator *iter);
409
410extern int
411seq_print_ip_sym(struct trace_seq *s, unsigned long ip,
412 unsigned long sym_flags);
396extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, 413extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf,
397 size_t cnt); 414 size_t cnt);
398extern long ns2usecs(cycle_t nsec); 415extern long ns2usecs(cycle_t nsec);
@@ -400,6 +417,17 @@ extern int trace_vprintk(unsigned long ip, const char *fmt, va_list args);
400 417
401extern unsigned long trace_flags; 418extern unsigned long trace_flags;
402 419
420/* Standard output formatting function used for function return traces */
421#ifdef CONFIG_FUNCTION_RET_TRACER
422extern enum print_line_t print_return_function(struct trace_iterator *iter);
423#else
424static inline enum print_line_t
425print_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
425extern struct tracer nop_trace; 460extern struct tracer nop_trace;
426 461
427/** 462/**