diff options
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r-- | include/linux/ftrace_event.h | 82 |
1 files changed, 65 insertions, 17 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 7024b7d1126f..ee8a8411b055 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -70,18 +70,25 @@ struct trace_iterator { | |||
70 | }; | 70 | }; |
71 | 71 | ||
72 | 72 | ||
73 | struct trace_event; | ||
74 | |||
73 | typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, | 75 | typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, |
74 | int flags); | 76 | int flags, struct trace_event *event); |
75 | struct trace_event { | 77 | |
76 | struct hlist_node node; | 78 | struct trace_event_functions { |
77 | struct list_head list; | ||
78 | int type; | ||
79 | trace_print_func trace; | 79 | trace_print_func trace; |
80 | trace_print_func raw; | 80 | trace_print_func raw; |
81 | trace_print_func hex; | 81 | trace_print_func hex; |
82 | trace_print_func binary; | 82 | trace_print_func binary; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | struct trace_event { | ||
86 | struct hlist_node node; | ||
87 | struct list_head list; | ||
88 | int type; | ||
89 | struct trace_event_functions *funcs; | ||
90 | }; | ||
91 | |||
85 | extern int register_ftrace_event(struct trace_event *event); | 92 | extern int register_ftrace_event(struct trace_event *event); |
86 | extern int unregister_ftrace_event(struct trace_event *event); | 93 | extern int unregister_ftrace_event(struct trace_event *event); |
87 | 94 | ||
@@ -113,29 +120,70 @@ void tracing_record_cmdline(struct task_struct *tsk); | |||
113 | 120 | ||
114 | struct event_filter; | 121 | struct event_filter; |
115 | 122 | ||
123 | enum trace_reg { | ||
124 | TRACE_REG_REGISTER, | ||
125 | TRACE_REG_UNREGISTER, | ||
126 | TRACE_REG_PERF_REGISTER, | ||
127 | TRACE_REG_PERF_UNREGISTER, | ||
128 | }; | ||
129 | |||
130 | struct ftrace_event_call; | ||
131 | |||
132 | struct ftrace_event_class { | ||
133 | char *system; | ||
134 | void *probe; | ||
135 | #ifdef CONFIG_PERF_EVENTS | ||
136 | void *perf_probe; | ||
137 | #endif | ||
138 | int (*reg)(struct ftrace_event_call *event, | ||
139 | enum trace_reg type); | ||
140 | int (*define_fields)(struct ftrace_event_call *); | ||
141 | struct list_head *(*get_fields)(struct ftrace_event_call *); | ||
142 | struct list_head fields; | ||
143 | int (*raw_init)(struct ftrace_event_call *); | ||
144 | }; | ||
145 | |||
146 | enum { | ||
147 | TRACE_EVENT_FL_ENABLED_BIT, | ||
148 | TRACE_EVENT_FL_FILTERED_BIT, | ||
149 | }; | ||
150 | |||
151 | enum { | ||
152 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), | ||
153 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | ||
154 | }; | ||
155 | |||
116 | struct ftrace_event_call { | 156 | struct ftrace_event_call { |
117 | struct list_head list; | 157 | struct list_head list; |
158 | struct ftrace_event_class *class; | ||
118 | char *name; | 159 | char *name; |
119 | char *system; | ||
120 | struct dentry *dir; | 160 | struct dentry *dir; |
121 | struct trace_event *event; | 161 | struct trace_event event; |
122 | int enabled; | ||
123 | int (*regfunc)(struct ftrace_event_call *); | ||
124 | void (*unregfunc)(struct ftrace_event_call *); | ||
125 | int id; | ||
126 | const char *print_fmt; | 162 | const char *print_fmt; |
127 | int (*raw_init)(struct ftrace_event_call *); | ||
128 | int (*define_fields)(struct ftrace_event_call *); | ||
129 | struct list_head fields; | ||
130 | int filter_active; | ||
131 | struct event_filter *filter; | 163 | struct event_filter *filter; |
132 | void *mod; | 164 | void *mod; |
133 | void *data; | 165 | void *data; |
134 | 166 | ||
167 | /* | ||
168 | * 32 bit flags: | ||
169 | * bit 1: enabled | ||
170 | * bit 2: filter_active | ||
171 | * | ||
172 | * Changes to flags must hold the event_mutex. | ||
173 | * | ||
174 | * Note: Reads of flags do not hold the event_mutex since | ||
175 | * they occur in critical sections. But the way flags | ||
176 | * is currently used, these changes do no affect the code | ||
177 | * except that when a change is made, it may have a slight | ||
178 | * delay in propagating the changes to other CPUs due to | ||
179 | * caching and such. | ||
180 | */ | ||
181 | unsigned int flags; | ||
182 | |||
183 | #ifdef CONFIG_PERF_EVENTS | ||
135 | int perf_refcount; | 184 | int perf_refcount; |
136 | struct hlist_head *perf_events; | 185 | struct hlist_head *perf_events; |
137 | int (*perf_event_enable)(struct ftrace_event_call *); | 186 | #endif |
138 | void (*perf_event_disable)(struct ftrace_event_call *); | ||
139 | }; | 187 | }; |
140 | 188 | ||
141 | #define PERF_MAX_TRACE_SIZE 2048 | 189 | #define PERF_MAX_TRACE_SIZE 2048 |