aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ftrace_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r--include/linux/ftrace_event.h43
1 files changed, 27 insertions, 16 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 4ec5e67e18cf..2233c98d80df 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -57,6 +57,7 @@ struct trace_iterator {
57 /* The below is zeroed out in pipe_read */ 57 /* The below is zeroed out in pipe_read */
58 struct trace_seq seq; 58 struct trace_seq seq;
59 struct trace_entry *ent; 59 struct trace_entry *ent;
60 int leftover;
60 int cpu; 61 int cpu;
61 u64 ts; 62 u64 ts;
62 63
@@ -117,12 +118,12 @@ struct ftrace_event_call {
117 struct dentry *dir; 118 struct dentry *dir;
118 struct trace_event *event; 119 struct trace_event *event;
119 int enabled; 120 int enabled;
120 int (*regfunc)(void *); 121 int (*regfunc)(struct ftrace_event_call *);
121 void (*unregfunc)(void *); 122 void (*unregfunc)(struct ftrace_event_call *);
122 int id; 123 int id;
123 int (*raw_init)(void); 124 int (*raw_init)(struct ftrace_event_call *);
124 int (*show_format)(struct ftrace_event_call *call, 125 int (*show_format)(struct ftrace_event_call *,
125 struct trace_seq *s); 126 struct trace_seq *);
126 int (*define_fields)(struct ftrace_event_call *); 127 int (*define_fields)(struct ftrace_event_call *);
127 struct list_head fields; 128 struct list_head fields;
128 int filter_active; 129 int filter_active;
@@ -130,21 +131,21 @@ struct ftrace_event_call {
130 void *mod; 131 void *mod;
131 void *data; 132 void *data;
132 133
133 atomic_t profile_count; 134 int profile_count;
134 int (*profile_enable)(void); 135 int (*profile_enable)(struct ftrace_event_call *);
135 void (*profile_disable)(void); 136 void (*profile_disable)(struct ftrace_event_call *);
136}; 137};
137 138
138#define FTRACE_MAX_PROFILE_SIZE 2048 139#define FTRACE_MAX_PROFILE_SIZE 2048
139 140
140extern char *trace_profile_buf; 141extern char *perf_trace_buf;
141extern char *trace_profile_buf_nmi; 142extern char *perf_trace_buf_nmi;
142 143
143#define MAX_FILTER_PRED 32 144#define MAX_FILTER_PRED 32
144#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ 145#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
145 146
146extern void destroy_preds(struct ftrace_event_call *call); 147extern void destroy_preds(struct ftrace_event_call *call);
147extern int filter_match_preds(struct ftrace_event_call *call, void *rec); 148extern int filter_match_preds(struct event_filter *filter, void *rec);
148extern int filter_current_check_discard(struct ring_buffer *buffer, 149extern int filter_current_check_discard(struct ring_buffer *buffer,
149 struct ftrace_event_call *call, 150 struct ftrace_event_call *call,
150 void *rec, 151 void *rec,
@@ -157,11 +158,12 @@ enum {
157 FILTER_PTR_STRING, 158 FILTER_PTR_STRING,
158}; 159};
159 160
160extern int trace_define_field(struct ftrace_event_call *call, 161extern int trace_event_raw_init(struct ftrace_event_call *call);
161 const char *type, const char *name, 162extern int trace_define_field(struct ftrace_event_call *call, const char *type,
162 int offset, int size, int is_signed, 163 const char *name, int offset, int size,
163 int filter_type); 164 int is_signed, int filter_type);
164extern int trace_define_common_fields(struct ftrace_event_call *call); 165extern int trace_add_event_call(struct ftrace_event_call *call);
166extern void trace_remove_event_call(struct ftrace_event_call *call);
165 167
166#define is_signed_type(type) (((type)(-1)) < 0) 168#define is_signed_type(type) (((type)(-1)) < 0)
167 169
@@ -186,4 +188,13 @@ do { \
186 __trace_printk(ip, fmt, ##args); \ 188 __trace_printk(ip, fmt, ##args); \
187} while (0) 189} while (0)
188 190
191#ifdef CONFIG_EVENT_PROFILE
192struct perf_event;
193extern int ftrace_profile_enable(int event_id);
194extern void ftrace_profile_disable(int event_id);
195extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
196 char *filter_str);
197extern void ftrace_profile_free_filter(struct perf_event *event);
198#endif
199
189#endif /* _LINUX_FTRACE_EVENT_H */ 200#endif /* _LINUX_FTRACE_EVENT_H */