diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-23 02:23:20 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-23 02:23:20 -0400 |
commit | 43315956509ca6913764861ac7dec128b91eb1ec (patch) | |
tree | 60fd5647f150a46e63093a41417c2eef3e776b3d /kernel/trace/trace.h | |
parent | 9bf4e7fba8006d19846fec877b6da0616b2772de (diff) | |
parent | 6beba7adbe092e63dfe8d09fbd1e3ec140474a13 (diff) |
Merge branch 'perf/core' into perf/probes
Conflicts:
tools/perf/Makefile
Merge reason:
- fix the conflict
- pick up the pr_*() infrastructure to queue up dependent patch
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 104c1a72418f..b4e4212e66d7 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -506,10 +506,6 @@ static inline int ftrace_graph_addr(unsigned long addr) | |||
506 | return 0; | 506 | return 0; |
507 | } | 507 | } |
508 | #else | 508 | #else |
509 | static inline int ftrace_trace_addr(unsigned long addr) | ||
510 | { | ||
511 | return 1; | ||
512 | } | ||
513 | static inline int ftrace_graph_addr(unsigned long addr) | 509 | static inline int ftrace_graph_addr(unsigned long addr) |
514 | { | 510 | { |
515 | return 1; | 511 | return 1; |
@@ -523,12 +519,12 @@ print_graph_function(struct trace_iterator *iter) | |||
523 | } | 519 | } |
524 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 520 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
525 | 521 | ||
526 | extern struct pid *ftrace_pid_trace; | 522 | extern struct list_head ftrace_pids; |
527 | 523 | ||
528 | #ifdef CONFIG_FUNCTION_TRACER | 524 | #ifdef CONFIG_FUNCTION_TRACER |
529 | static inline int ftrace_trace_task(struct task_struct *task) | 525 | static inline int ftrace_trace_task(struct task_struct *task) |
530 | { | 526 | { |
531 | if (!ftrace_pid_trace) | 527 | if (list_empty(&ftrace_pids)) |
532 | return 1; | 528 | return 1; |
533 | 529 | ||
534 | return test_tsk_trace_trace(task); | 530 | return test_tsk_trace_trace(task); |
@@ -710,7 +706,6 @@ struct event_filter { | |||
710 | int n_preds; | 706 | int n_preds; |
711 | struct filter_pred **preds; | 707 | struct filter_pred **preds; |
712 | char *filter_string; | 708 | char *filter_string; |
713 | bool no_reset; | ||
714 | }; | 709 | }; |
715 | 710 | ||
716 | struct event_subsystem { | 711 | struct event_subsystem { |
@@ -722,22 +717,40 @@ struct event_subsystem { | |||
722 | }; | 717 | }; |
723 | 718 | ||
724 | struct filter_pred; | 719 | struct filter_pred; |
720 | struct regex; | ||
725 | 721 | ||
726 | typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event, | 722 | typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event, |
727 | int val1, int val2); | 723 | int val1, int val2); |
728 | 724 | ||
725 | typedef int (*regex_match_func)(char *str, struct regex *r, int len); | ||
726 | |||
727 | enum regex_type { | ||
728 | MATCH_FULL = 0, | ||
729 | MATCH_FRONT_ONLY, | ||
730 | MATCH_MIDDLE_ONLY, | ||
731 | MATCH_END_ONLY, | ||
732 | }; | ||
733 | |||
734 | struct regex { | ||
735 | char pattern[MAX_FILTER_STR_VAL]; | ||
736 | int len; | ||
737 | int field_len; | ||
738 | regex_match_func match; | ||
739 | }; | ||
740 | |||
729 | struct filter_pred { | 741 | struct filter_pred { |
730 | filter_pred_fn_t fn; | 742 | filter_pred_fn_t fn; |
731 | u64 val; | 743 | u64 val; |
732 | char str_val[MAX_FILTER_STR_VAL]; | 744 | struct regex regex; |
733 | int str_len; | 745 | char *field_name; |
734 | char *field_name; | 746 | int offset; |
735 | int offset; | 747 | int not; |
736 | int not; | 748 | int op; |
737 | int op; | 749 | int pop_n; |
738 | int pop_n; | ||
739 | }; | 750 | }; |
740 | 751 | ||
752 | extern enum regex_type | ||
753 | filter_parse_regex(char *buff, int len, char **search, int *not); | ||
741 | extern void print_event_filter(struct ftrace_event_call *call, | 754 | extern void print_event_filter(struct ftrace_event_call *call, |
742 | struct trace_seq *s); | 755 | struct trace_seq *s); |
743 | extern int apply_event_filter(struct ftrace_event_call *call, | 756 | extern int apply_event_filter(struct ftrace_event_call *call, |
@@ -753,7 +766,8 @@ filter_check_discard(struct ftrace_event_call *call, void *rec, | |||
753 | struct ring_buffer *buffer, | 766 | struct ring_buffer *buffer, |
754 | struct ring_buffer_event *event) | 767 | struct ring_buffer_event *event) |
755 | { | 768 | { |
756 | if (unlikely(call->filter_active) && !filter_match_preds(call, rec)) { | 769 | if (unlikely(call->filter_active) && |
770 | !filter_match_preds(call->filter, rec)) { | ||
757 | ring_buffer_discard_commit(buffer, event); | 771 | ring_buffer_discard_commit(buffer, event); |
758 | return 1; | 772 | return 1; |
759 | } | 773 | } |