diff options
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 76 |
1 files changed, 54 insertions, 22 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 8b9f4f6e9559..fa1dccb579d5 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -34,8 +34,6 @@ enum trace_type { | |||
34 | TRACE_GRAPH_ENT, | 34 | TRACE_GRAPH_ENT, |
35 | TRACE_USER_STACK, | 35 | TRACE_USER_STACK, |
36 | TRACE_HW_BRANCHES, | 36 | TRACE_HW_BRANCHES, |
37 | TRACE_SYSCALL_ENTER, | ||
38 | TRACE_SYSCALL_EXIT, | ||
39 | TRACE_KMEM_ALLOC, | 37 | TRACE_KMEM_ALLOC, |
40 | TRACE_KMEM_FREE, | 38 | TRACE_KMEM_FREE, |
41 | TRACE_POWER, | 39 | TRACE_POWER, |
@@ -236,9 +234,6 @@ struct trace_array_cpu { | |||
236 | atomic_t disabled; | 234 | atomic_t disabled; |
237 | void *buffer_page; /* ring buffer spare */ | 235 | void *buffer_page; /* ring buffer spare */ |
238 | 236 | ||
239 | /* these fields get copied into max-trace: */ | ||
240 | unsigned long trace_idx; | ||
241 | unsigned long overrun; | ||
242 | unsigned long saved_latency; | 237 | unsigned long saved_latency; |
243 | unsigned long critical_start; | 238 | unsigned long critical_start; |
244 | unsigned long critical_end; | 239 | unsigned long critical_end; |
@@ -246,6 +241,7 @@ struct trace_array_cpu { | |||
246 | unsigned long nice; | 241 | unsigned long nice; |
247 | unsigned long policy; | 242 | unsigned long policy; |
248 | unsigned long rt_priority; | 243 | unsigned long rt_priority; |
244 | unsigned long skipped_entries; | ||
249 | cycle_t preempt_timestamp; | 245 | cycle_t preempt_timestamp; |
250 | pid_t pid; | 246 | pid_t pid; |
251 | uid_t uid; | 247 | uid_t uid; |
@@ -319,10 +315,6 @@ extern void __ftrace_bad_type(void); | |||
319 | TRACE_KMEM_ALLOC); \ | 315 | TRACE_KMEM_ALLOC); \ |
320 | IF_ASSIGN(var, ent, struct kmemtrace_free_entry, \ | 316 | IF_ASSIGN(var, ent, struct kmemtrace_free_entry, \ |
321 | TRACE_KMEM_FREE); \ | 317 | TRACE_KMEM_FREE); \ |
322 | IF_ASSIGN(var, ent, struct syscall_trace_enter, \ | ||
323 | TRACE_SYSCALL_ENTER); \ | ||
324 | IF_ASSIGN(var, ent, struct syscall_trace_exit, \ | ||
325 | TRACE_SYSCALL_EXIT); \ | ||
326 | __ftrace_bad_type(); \ | 318 | __ftrace_bad_type(); \ |
327 | } while (0) | 319 | } while (0) |
328 | 320 | ||
@@ -423,12 +415,13 @@ void init_tracer_sysprof_debugfs(struct dentry *d_tracer); | |||
423 | 415 | ||
424 | struct ring_buffer_event; | 416 | struct ring_buffer_event; |
425 | 417 | ||
426 | struct ring_buffer_event *trace_buffer_lock_reserve(struct trace_array *tr, | 418 | struct ring_buffer_event * |
427 | int type, | 419 | trace_buffer_lock_reserve(struct ring_buffer *buffer, |
428 | unsigned long len, | 420 | int type, |
429 | unsigned long flags, | 421 | unsigned long len, |
430 | int pc); | 422 | unsigned long flags, |
431 | void trace_buffer_unlock_commit(struct trace_array *tr, | 423 | int pc); |
424 | void trace_buffer_unlock_commit(struct ring_buffer *buffer, | ||
432 | struct ring_buffer_event *event, | 425 | struct ring_buffer_event *event, |
433 | unsigned long flags, int pc); | 426 | unsigned long flags, int pc); |
434 | 427 | ||
@@ -467,6 +460,7 @@ void trace_function(struct trace_array *tr, | |||
467 | 460 | ||
468 | void trace_graph_return(struct ftrace_graph_ret *trace); | 461 | void trace_graph_return(struct ftrace_graph_ret *trace); |
469 | int trace_graph_entry(struct ftrace_graph_ent *trace); | 462 | int trace_graph_entry(struct ftrace_graph_ent *trace); |
463 | void set_graph_array(struct trace_array *tr); | ||
470 | 464 | ||
471 | void tracing_start_cmdline_record(void); | 465 | void tracing_start_cmdline_record(void); |
472 | void tracing_stop_cmdline_record(void); | 466 | void tracing_stop_cmdline_record(void); |
@@ -478,16 +472,40 @@ void unregister_tracer(struct tracer *type); | |||
478 | 472 | ||
479 | extern unsigned long nsecs_to_usecs(unsigned long nsecs); | 473 | extern unsigned long nsecs_to_usecs(unsigned long nsecs); |
480 | 474 | ||
475 | #ifdef CONFIG_TRACER_MAX_TRACE | ||
481 | extern unsigned long tracing_max_latency; | 476 | extern unsigned long tracing_max_latency; |
482 | extern unsigned long tracing_thresh; | 477 | extern unsigned long tracing_thresh; |
483 | 478 | ||
484 | void update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu); | 479 | void update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu); |
485 | void update_max_tr_single(struct trace_array *tr, | 480 | void update_max_tr_single(struct trace_array *tr, |
486 | struct task_struct *tsk, int cpu); | 481 | struct task_struct *tsk, int cpu); |
482 | #endif /* CONFIG_TRACER_MAX_TRACE */ | ||
487 | 483 | ||
488 | void __trace_stack(struct trace_array *tr, | 484 | #ifdef CONFIG_STACKTRACE |
489 | unsigned long flags, | 485 | void ftrace_trace_stack(struct ring_buffer *buffer, unsigned long flags, |
490 | int skip, int pc); | 486 | int skip, int pc); |
487 | |||
488 | void ftrace_trace_userstack(struct ring_buffer *buffer, unsigned long flags, | ||
489 | int pc); | ||
490 | |||
491 | void __trace_stack(struct trace_array *tr, unsigned long flags, int skip, | ||
492 | int pc); | ||
493 | #else | ||
494 | static inline void ftrace_trace_stack(struct trace_array *tr, | ||
495 | unsigned long flags, int skip, int pc) | ||
496 | { | ||
497 | } | ||
498 | |||
499 | static inline void ftrace_trace_userstack(struct trace_array *tr, | ||
500 | unsigned long flags, int pc) | ||
501 | { | ||
502 | } | ||
503 | |||
504 | static inline void __trace_stack(struct trace_array *tr, unsigned long flags, | ||
505 | int skip, int pc) | ||
506 | { | ||
507 | } | ||
508 | #endif /* CONFIG_STACKTRACE */ | ||
491 | 509 | ||
492 | extern cycle_t ftrace_now(int cpu); | 510 | extern cycle_t ftrace_now(int cpu); |
493 | 511 | ||
@@ -513,6 +531,10 @@ extern unsigned long ftrace_update_tot_cnt; | |||
513 | extern int DYN_FTRACE_TEST_NAME(void); | 531 | extern int DYN_FTRACE_TEST_NAME(void); |
514 | #endif | 532 | #endif |
515 | 533 | ||
534 | extern int ring_buffer_expanded; | ||
535 | extern bool tracing_selftest_disabled; | ||
536 | DECLARE_PER_CPU(local_t, ftrace_cpu_disabled); | ||
537 | |||
516 | #ifdef CONFIG_FTRACE_STARTUP_TEST | 538 | #ifdef CONFIG_FTRACE_STARTUP_TEST |
517 | extern int trace_selftest_startup_function(struct tracer *trace, | 539 | extern int trace_selftest_startup_function(struct tracer *trace, |
518 | struct trace_array *tr); | 540 | struct trace_array *tr); |
@@ -544,9 +566,16 @@ extern int | |||
544 | trace_vbprintk(unsigned long ip, const char *fmt, va_list args); | 566 | trace_vbprintk(unsigned long ip, const char *fmt, va_list args); |
545 | extern int | 567 | extern int |
546 | trace_vprintk(unsigned long ip, const char *fmt, va_list args); | 568 | trace_vprintk(unsigned long ip, const char *fmt, va_list args); |
569 | extern int | ||
570 | trace_array_vprintk(struct trace_array *tr, | ||
571 | unsigned long ip, const char *fmt, va_list args); | ||
572 | int trace_array_printk(struct trace_array *tr, | ||
573 | unsigned long ip, const char *fmt, ...); | ||
547 | 574 | ||
548 | extern unsigned long trace_flags; | 575 | extern unsigned long trace_flags; |
549 | 576 | ||
577 | extern int trace_clock_id; | ||
578 | |||
550 | /* Standard output formatting function used for function return traces */ | 579 | /* Standard output formatting function used for function return traces */ |
551 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 580 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
552 | extern enum print_line_t print_graph_function(struct trace_iterator *iter); | 581 | extern enum print_line_t print_graph_function(struct trace_iterator *iter); |
@@ -635,9 +664,8 @@ enum trace_iterator_flags { | |||
635 | TRACE_ITER_PRINTK_MSGONLY = 0x10000, | 664 | TRACE_ITER_PRINTK_MSGONLY = 0x10000, |
636 | TRACE_ITER_CONTEXT_INFO = 0x20000, /* Print pid/cpu/time */ | 665 | TRACE_ITER_CONTEXT_INFO = 0x20000, /* Print pid/cpu/time */ |
637 | TRACE_ITER_LATENCY_FMT = 0x40000, | 666 | TRACE_ITER_LATENCY_FMT = 0x40000, |
638 | TRACE_ITER_GLOBAL_CLK = 0x80000, | 667 | TRACE_ITER_SLEEP_TIME = 0x80000, |
639 | TRACE_ITER_SLEEP_TIME = 0x100000, | 668 | TRACE_ITER_GRAPH_TIME = 0x100000, |
640 | TRACE_ITER_GRAPH_TIME = 0x200000, | ||
641 | }; | 669 | }; |
642 | 670 | ||
643 | /* | 671 | /* |
@@ -734,6 +762,7 @@ struct ftrace_event_field { | |||
734 | struct list_head link; | 762 | struct list_head link; |
735 | char *name; | 763 | char *name; |
736 | char *type; | 764 | char *type; |
765 | int filter_type; | ||
737 | int offset; | 766 | int offset; |
738 | int size; | 767 | int size; |
739 | int is_signed; | 768 | int is_signed; |
@@ -743,13 +772,15 @@ struct event_filter { | |||
743 | int n_preds; | 772 | int n_preds; |
744 | struct filter_pred **preds; | 773 | struct filter_pred **preds; |
745 | char *filter_string; | 774 | char *filter_string; |
775 | bool no_reset; | ||
746 | }; | 776 | }; |
747 | 777 | ||
748 | struct event_subsystem { | 778 | struct event_subsystem { |
749 | struct list_head list; | 779 | struct list_head list; |
750 | const char *name; | 780 | const char *name; |
751 | struct dentry *entry; | 781 | struct dentry *entry; |
752 | void *filter; | 782 | struct event_filter *filter; |
783 | int nr_events; | ||
753 | }; | 784 | }; |
754 | 785 | ||
755 | struct filter_pred; | 786 | struct filter_pred; |
@@ -777,6 +808,7 @@ extern int apply_subsystem_event_filter(struct event_subsystem *system, | |||
777 | char *filter_string); | 808 | char *filter_string); |
778 | extern void print_subsystem_event_filter(struct event_subsystem *system, | 809 | extern void print_subsystem_event_filter(struct event_subsystem *system, |
779 | struct trace_seq *s); | 810 | struct trace_seq *s); |
811 | extern int filter_assign_type(const char *type); | ||
780 | 812 | ||
781 | static inline int | 813 | static inline int |
782 | filter_check_discard(struct ftrace_event_call *call, void *rec, | 814 | filter_check_discard(struct ftrace_event_call *call, void *rec, |