aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h50
1 files changed, 30 insertions, 20 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 73d08aa25b55..ea189e027b80 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -193,8 +193,8 @@ struct trace_array {
193#ifdef CONFIG_FTRACE_SYSCALLS 193#ifdef CONFIG_FTRACE_SYSCALLS
194 int sys_refcount_enter; 194 int sys_refcount_enter;
195 int sys_refcount_exit; 195 int sys_refcount_exit;
196 DECLARE_BITMAP(enabled_enter_syscalls, NR_syscalls); 196 struct ftrace_event_file __rcu *enter_syscall_files[NR_syscalls];
197 DECLARE_BITMAP(enabled_exit_syscalls, NR_syscalls); 197 struct ftrace_event_file __rcu *exit_syscall_files[NR_syscalls];
198#endif 198#endif
199 int stop_count; 199 int stop_count;
200 int clock_id; 200 int clock_id;
@@ -515,6 +515,7 @@ void tracing_reset_online_cpus(struct trace_buffer *buf);
515void tracing_reset_current(int cpu); 515void tracing_reset_current(int cpu);
516void tracing_reset_all_online_cpus(void); 516void tracing_reset_all_online_cpus(void);
517int tracing_open_generic(struct inode *inode, struct file *filp); 517int tracing_open_generic(struct inode *inode, struct file *filp);
518bool tracing_is_disabled(void);
518struct dentry *trace_create_file(const char *name, 519struct dentry *trace_create_file(const char *name,
519 umode_t mode, 520 umode_t mode,
520 struct dentry *parent, 521 struct dentry *parent,
@@ -712,6 +713,8 @@ extern unsigned long trace_flags;
712#define TRACE_GRAPH_PRINT_PROC 0x8 713#define TRACE_GRAPH_PRINT_PROC 0x8
713#define TRACE_GRAPH_PRINT_DURATION 0x10 714#define TRACE_GRAPH_PRINT_DURATION 0x10
714#define TRACE_GRAPH_PRINT_ABS_TIME 0x20 715#define TRACE_GRAPH_PRINT_ABS_TIME 0x20
716#define TRACE_GRAPH_PRINT_FILL_SHIFT 28
717#define TRACE_GRAPH_PRINT_FILL_MASK (0x3 << TRACE_GRAPH_PRINT_FILL_SHIFT)
715 718
716extern enum print_line_t 719extern enum print_line_t
717print_graph_function_flags(struct trace_iterator *iter, u32 flags); 720print_graph_function_flags(struct trace_iterator *iter, u32 flags);
@@ -731,15 +734,16 @@ extern void __trace_graph_return(struct trace_array *tr,
731#ifdef CONFIG_DYNAMIC_FTRACE 734#ifdef CONFIG_DYNAMIC_FTRACE
732/* TODO: make this variable */ 735/* TODO: make this variable */
733#define FTRACE_GRAPH_MAX_FUNCS 32 736#define FTRACE_GRAPH_MAX_FUNCS 32
734extern int ftrace_graph_filter_enabled;
735extern int ftrace_graph_count; 737extern int ftrace_graph_count;
736extern unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS]; 738extern unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS];
739extern int ftrace_graph_notrace_count;
740extern unsigned long ftrace_graph_notrace_funcs[FTRACE_GRAPH_MAX_FUNCS];
737 741
738static inline int ftrace_graph_addr(unsigned long addr) 742static inline int ftrace_graph_addr(unsigned long addr)
739{ 743{
740 int i; 744 int i;
741 745
742 if (!ftrace_graph_filter_enabled) 746 if (!ftrace_graph_count)
743 return 1; 747 return 1;
744 748
745 for (i = 0; i < ftrace_graph_count; i++) { 749 for (i = 0; i < ftrace_graph_count; i++) {
@@ -759,11 +763,31 @@ static inline int ftrace_graph_addr(unsigned long addr)
759 763
760 return 0; 764 return 0;
761} 765}
766
767static inline int ftrace_graph_notrace_addr(unsigned long addr)
768{
769 int i;
770
771 if (!ftrace_graph_notrace_count)
772 return 0;
773
774 for (i = 0; i < ftrace_graph_notrace_count; i++) {
775 if (addr == ftrace_graph_notrace_funcs[i])
776 return 1;
777 }
778
779 return 0;
780}
762#else 781#else
763static inline int ftrace_graph_addr(unsigned long addr) 782static inline int ftrace_graph_addr(unsigned long addr)
764{ 783{
765 return 1; 784 return 1;
766} 785}
786
787static inline int ftrace_graph_notrace_addr(unsigned long addr)
788{
789 return 0;
790}
767#endif /* CONFIG_DYNAMIC_FTRACE */ 791#endif /* CONFIG_DYNAMIC_FTRACE */
768#else /* CONFIG_FUNCTION_GRAPH_TRACER */ 792#else /* CONFIG_FUNCTION_GRAPH_TRACER */
769static inline enum print_line_t 793static inline enum print_line_t
@@ -987,9 +1011,9 @@ struct filter_pred {
987 1011
988extern enum regex_type 1012extern enum regex_type
989filter_parse_regex(char *buff, int len, char **search, int *not); 1013filter_parse_regex(char *buff, int len, char **search, int *not);
990extern void print_event_filter(struct ftrace_event_call *call, 1014extern void print_event_filter(struct ftrace_event_file *file,
991 struct trace_seq *s); 1015 struct trace_seq *s);
992extern int apply_event_filter(struct ftrace_event_call *call, 1016extern int apply_event_filter(struct ftrace_event_file *file,
993 char *filter_string); 1017 char *filter_string);
994extern int apply_subsystem_event_filter(struct ftrace_subsystem_dir *dir, 1018extern int apply_subsystem_event_filter(struct ftrace_subsystem_dir *dir,
995 char *filter_string); 1019 char *filter_string);
@@ -1000,20 +1024,6 @@ extern int filter_assign_type(const char *type);
1000struct ftrace_event_field * 1024struct ftrace_event_field *
1001trace_find_event_field(struct ftrace_event_call *call, char *name); 1025trace_find_event_field(struct ftrace_event_call *call, char *name);
1002 1026
1003static inline int
1004filter_check_discard(struct ftrace_event_call *call, void *rec,
1005 struct ring_buffer *buffer,
1006 struct ring_buffer_event *event)
1007{
1008 if (unlikely(call->flags & TRACE_EVENT_FL_FILTERED) &&
1009 !filter_match_preds(call->filter, rec)) {
1010 ring_buffer_discard_commit(buffer, event);
1011 return 1;
1012 }
1013
1014 return 0;
1015}
1016
1017extern void trace_event_enable_cmd_record(bool enable); 1027extern void trace_event_enable_cmd_record(bool enable);
1018extern int event_trace_add_tracer(struct dentry *parent, struct trace_array *tr); 1028extern int event_trace_add_tracer(struct dentry *parent, struct trace_array *tr);
1019extern int event_trace_del_tracer(struct trace_array *tr); 1029extern int event_trace_del_tracer(struct trace_array *tr);