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.h67
1 files changed, 42 insertions, 25 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index a81170de7f6b..4ec5e67e18cf 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -1,9 +1,10 @@
1#ifndef _LINUX_FTRACE_EVENT_H 1#ifndef _LINUX_FTRACE_EVENT_H
2#define _LINUX_FTRACE_EVENT_H 2#define _LINUX_FTRACE_EVENT_H
3 3
4#include <linux/trace_seq.h>
5#include <linux/ring_buffer.h> 4#include <linux/ring_buffer.h>
5#include <linux/trace_seq.h>
6#include <linux/percpu.h> 6#include <linux/percpu.h>
7#include <linux/hardirq.h>
7 8
8struct trace_array; 9struct trace_array;
9struct tracer; 10struct tracer;
@@ -34,7 +35,7 @@ struct trace_entry {
34 unsigned char flags; 35 unsigned char flags;
35 unsigned char preempt_count; 36 unsigned char preempt_count;
36 int pid; 37 int pid;
37 int tgid; 38 int lock_depth;
38}; 39};
39 40
40#define FTRACE_MAX_EVENT \ 41#define FTRACE_MAX_EVENT \
@@ -93,16 +94,22 @@ void tracing_generic_entry_update(struct trace_entry *entry,
93 unsigned long flags, 94 unsigned long flags,
94 int pc); 95 int pc);
95struct ring_buffer_event * 96struct ring_buffer_event *
96trace_current_buffer_lock_reserve(int type, unsigned long len, 97trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer,
98 int type, unsigned long len,
97 unsigned long flags, int pc); 99 unsigned long flags, int pc);
98void trace_current_buffer_unlock_commit(struct ring_buffer_event *event, 100void trace_current_buffer_unlock_commit(struct ring_buffer *buffer,
101 struct ring_buffer_event *event,
99 unsigned long flags, int pc); 102 unsigned long flags, int pc);
100void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event, 103void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer,
104 struct ring_buffer_event *event,
101 unsigned long flags, int pc); 105 unsigned long flags, int pc);
102void trace_current_buffer_discard_commit(struct ring_buffer_event *event); 106void trace_current_buffer_discard_commit(struct ring_buffer *buffer,
107 struct ring_buffer_event *event);
103 108
104void tracing_record_cmdline(struct task_struct *tsk); 109void tracing_record_cmdline(struct task_struct *tsk);
105 110
111struct event_filter;
112
106struct ftrace_event_call { 113struct ftrace_event_call {
107 struct list_head list; 114 struct list_head list;
108 char *name; 115 char *name;
@@ -110,34 +117,51 @@ struct ftrace_event_call {
110 struct dentry *dir; 117 struct dentry *dir;
111 struct trace_event *event; 118 struct trace_event *event;
112 int enabled; 119 int enabled;
113 int (*regfunc)(void); 120 int (*regfunc)(void *);
114 void (*unregfunc)(void); 121 void (*unregfunc)(void *);
115 int id; 122 int id;
116 int (*raw_init)(void); 123 int (*raw_init)(void);
117 int (*show_format)(struct trace_seq *s); 124 int (*show_format)(struct ftrace_event_call *call,
118 int (*define_fields)(void); 125 struct trace_seq *s);
126 int (*define_fields)(struct ftrace_event_call *);
119 struct list_head fields; 127 struct list_head fields;
120 int filter_active; 128 int filter_active;
121 void *filter; 129 struct event_filter *filter;
122 void *mod; 130 void *mod;
131 void *data;
123 132
124 atomic_t profile_count; 133 atomic_t profile_count;
125 int (*profile_enable)(struct ftrace_event_call *); 134 int (*profile_enable)(void);
126 void (*profile_disable)(struct ftrace_event_call *); 135 void (*profile_disable)(void);
127}; 136};
128 137
138#define FTRACE_MAX_PROFILE_SIZE 2048
139
140extern char *trace_profile_buf;
141extern char *trace_profile_buf_nmi;
142
129#define MAX_FILTER_PRED 32 143#define MAX_FILTER_PRED 32
130#define MAX_FILTER_STR_VAL 128 144#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
131 145
132extern int init_preds(struct ftrace_event_call *call);
133extern void destroy_preds(struct ftrace_event_call *call); 146extern void destroy_preds(struct ftrace_event_call *call);
134extern int filter_match_preds(struct ftrace_event_call *call, void *rec); 147extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
135extern int filter_current_check_discard(struct ftrace_event_call *call, 148extern int filter_current_check_discard(struct ring_buffer *buffer,
149 struct ftrace_event_call *call,
136 void *rec, 150 void *rec,
137 struct ring_buffer_event *event); 151 struct ring_buffer_event *event);
138 152
139extern int trace_define_field(struct ftrace_event_call *call, char *type, 153enum {
140 char *name, int offset, int size, int is_signed); 154 FILTER_OTHER = 0,
155 FILTER_STATIC_STRING,
156 FILTER_DYN_STRING,
157 FILTER_PTR_STRING,
158};
159
160extern int trace_define_field(struct ftrace_event_call *call,
161 const char *type, const char *name,
162 int offset, int size, int is_signed,
163 int filter_type);
164extern int trace_define_common_fields(struct ftrace_event_call *call);
141 165
142#define is_signed_type(type) (((type)(-1)) < 0) 166#define is_signed_type(type) (((type)(-1)) < 0)
143 167
@@ -162,11 +186,4 @@ do { \
162 __trace_printk(ip, fmt, ##args); \ 186 __trace_printk(ip, fmt, ##args); \
163} while (0) 187} while (0)
164 188
165#define __common_field(type, item, is_signed) \
166 ret = trace_define_field(event_call, #type, "common_" #item, \
167 offsetof(typeof(field.ent), item), \
168 sizeof(field.ent.item), is_signed); \
169 if (ret) \
170 return ret;
171
172#endif /* _LINUX_FTRACE_EVENT_H */ 189#endif /* _LINUX_FTRACE_EVENT_H */