diff options
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 62 |
1 files changed, 55 insertions, 7 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index d39b3c5454a5..229f8591f61d 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -272,8 +272,8 @@ struct tracer { | |||
272 | /* If you handled the flag setting, return 0 */ | 272 | /* If you handled the flag setting, return 0 */ |
273 | int (*set_flag)(u32 old_flags, u32 bit, int set); | 273 | int (*set_flag)(u32 old_flags, u32 bit, int set); |
274 | struct tracer *next; | 274 | struct tracer *next; |
275 | int print_max; | ||
276 | struct tracer_flags *flags; | 275 | struct tracer_flags *flags; |
276 | int print_max; | ||
277 | int use_max_tr; | 277 | int use_max_tr; |
278 | }; | 278 | }; |
279 | 279 | ||
@@ -343,6 +343,10 @@ void trace_function(struct trace_array *tr, | |||
343 | unsigned long ip, | 343 | unsigned long ip, |
344 | unsigned long parent_ip, | 344 | unsigned long parent_ip, |
345 | unsigned long flags, int pc); | 345 | unsigned long flags, int pc); |
346 | void trace_graph_function(struct trace_array *tr, | ||
347 | unsigned long ip, | ||
348 | unsigned long parent_ip, | ||
349 | unsigned long flags, int pc); | ||
346 | void trace_default_header(struct seq_file *m); | 350 | void trace_default_header(struct seq_file *m); |
347 | void print_trace_header(struct seq_file *m, struct trace_iterator *iter); | 351 | void print_trace_header(struct seq_file *m, struct trace_iterator *iter); |
348 | int trace_empty(struct trace_iterator *iter); | 352 | int trace_empty(struct trace_iterator *iter); |
@@ -415,6 +419,8 @@ extern void trace_find_cmdline(int pid, char comm[]); | |||
415 | extern unsigned long ftrace_update_tot_cnt; | 419 | extern unsigned long ftrace_update_tot_cnt; |
416 | #define DYN_FTRACE_TEST_NAME trace_selftest_dynamic_test_func | 420 | #define DYN_FTRACE_TEST_NAME trace_selftest_dynamic_test_func |
417 | extern int DYN_FTRACE_TEST_NAME(void); | 421 | extern int DYN_FTRACE_TEST_NAME(void); |
422 | #define DYN_FTRACE_TEST_NAME2 trace_selftest_dynamic_test_func2 | ||
423 | extern int DYN_FTRACE_TEST_NAME2(void); | ||
418 | #endif | 424 | #endif |
419 | 425 | ||
420 | extern int ring_buffer_expanded; | 426 | extern int ring_buffer_expanded; |
@@ -602,6 +608,7 @@ enum trace_iterator_flags { | |||
602 | TRACE_ITER_SLEEP_TIME = 0x40000, | 608 | TRACE_ITER_SLEEP_TIME = 0x40000, |
603 | TRACE_ITER_GRAPH_TIME = 0x80000, | 609 | TRACE_ITER_GRAPH_TIME = 0x80000, |
604 | TRACE_ITER_RECORD_CMD = 0x100000, | 610 | TRACE_ITER_RECORD_CMD = 0x100000, |
611 | TRACE_ITER_OVERWRITE = 0x200000, | ||
605 | }; | 612 | }; |
606 | 613 | ||
607 | /* | 614 | /* |
@@ -657,8 +664,10 @@ struct ftrace_event_field { | |||
657 | }; | 664 | }; |
658 | 665 | ||
659 | struct event_filter { | 666 | struct event_filter { |
660 | int n_preds; | 667 | int n_preds; /* Number assigned */ |
661 | struct filter_pred **preds; | 668 | int a_preds; /* allocated */ |
669 | struct filter_pred *preds; | ||
670 | struct filter_pred *root; | ||
662 | char *filter_string; | 671 | char *filter_string; |
663 | }; | 672 | }; |
664 | 673 | ||
@@ -670,11 +679,23 @@ struct event_subsystem { | |||
670 | int nr_events; | 679 | int nr_events; |
671 | }; | 680 | }; |
672 | 681 | ||
682 | #define FILTER_PRED_INVALID ((unsigned short)-1) | ||
683 | #define FILTER_PRED_IS_RIGHT (1 << 15) | ||
684 | #define FILTER_PRED_FOLD (1 << 15) | ||
685 | |||
686 | /* | ||
687 | * The max preds is the size of unsigned short with | ||
688 | * two flags at the MSBs. One bit is used for both the IS_RIGHT | ||
689 | * and FOLD flags. The other is reserved. | ||
690 | * | ||
691 | * 2^14 preds is way more than enough. | ||
692 | */ | ||
693 | #define MAX_FILTER_PRED 16384 | ||
694 | |||
673 | struct filter_pred; | 695 | struct filter_pred; |
674 | struct regex; | 696 | struct regex; |
675 | 697 | ||
676 | typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event, | 698 | typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event); |
677 | int val1, int val2); | ||
678 | 699 | ||
679 | typedef int (*regex_match_func)(char *str, struct regex *r, int len); | 700 | typedef int (*regex_match_func)(char *str, struct regex *r, int len); |
680 | 701 | ||
@@ -696,11 +717,23 @@ struct filter_pred { | |||
696 | filter_pred_fn_t fn; | 717 | filter_pred_fn_t fn; |
697 | u64 val; | 718 | u64 val; |
698 | struct regex regex; | 719 | struct regex regex; |
699 | char *field_name; | 720 | /* |
721 | * Leaf nodes use field_name, ops is used by AND and OR | ||
722 | * nodes. The field_name is always freed when freeing a pred. | ||
723 | * We can overload field_name for ops and have it freed | ||
724 | * as well. | ||
725 | */ | ||
726 | union { | ||
727 | char *field_name; | ||
728 | unsigned short *ops; | ||
729 | }; | ||
700 | int offset; | 730 | int offset; |
701 | int not; | 731 | int not; |
702 | int op; | 732 | int op; |
703 | int pop_n; | 733 | unsigned short index; |
734 | unsigned short parent; | ||
735 | unsigned short left; | ||
736 | unsigned short right; | ||
704 | }; | 737 | }; |
705 | 738 | ||
706 | extern struct list_head ftrace_common_fields; | 739 | extern struct list_head ftrace_common_fields; |
@@ -751,4 +784,19 @@ extern const char *__stop___trace_bprintk_fmt[]; | |||
751 | FTRACE_ENTRY(call, struct_name, id, PARAMS(tstruct), PARAMS(print)) | 784 | FTRACE_ENTRY(call, struct_name, id, PARAMS(tstruct), PARAMS(print)) |
752 | #include "trace_entries.h" | 785 | #include "trace_entries.h" |
753 | 786 | ||
787 | /* Only current can touch trace_recursion */ | ||
788 | #define trace_recursion_inc() do { (current)->trace_recursion++; } while (0) | ||
789 | #define trace_recursion_dec() do { (current)->trace_recursion--; } while (0) | ||
790 | |||
791 | /* Ring buffer has the 10 LSB bits to count */ | ||
792 | #define trace_recursion_buffer() ((current)->trace_recursion & 0x3ff) | ||
793 | |||
794 | /* for function tracing recursion */ | ||
795 | #define TRACE_INTERNAL_BIT (1<<11) | ||
796 | #define TRACE_GLOBAL_BIT (1<<12) | ||
797 | |||
798 | #define trace_recursion_set(bit) do { (current)->trace_recursion |= (bit); } while (0) | ||
799 | #define trace_recursion_clear(bit) do { (current)->trace_recursion &= ~(bit); } while (0) | ||
800 | #define trace_recursion_test(bit) ((current)->trace_recursion & (bit)) | ||
801 | |||
754 | #endif /* _LINUX_KERNEL_TRACE_H */ | 802 | #endif /* _LINUX_KERNEL_TRACE_H */ |