aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-05-11 13:29:49 -0400
committerSteven Rostedt <rostedt@goodmis.org>2013-03-15 00:34:42 -0400
commit2b6080f28c7cc3efc8625ab71495aae89aeb63a0 (patch)
treef3fe3b8a7ce99dda0da01f097255cae596083c88 /kernel/trace/trace.h
parentae3b5093ad6004b52e2825f3db1ad8200a2724d8 (diff)
tracing: Encapsulate global_trace and remove dependencies on global vars
The global_trace variable in kernel/trace/trace.c has been kept 'static' and local to that file so that it would not be used too much outside of that file. This has paid off, even though there were lots of changes to make the trace_array structure more generic (not depending on global_trace). Removal of a lot of direct usages of global_trace is needed to be able to create more trace_arrays such that we can add multiple buffers. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index da09a037abcd..b80fbcf70af4 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -127,12 +127,21 @@ enum trace_flag_type {
127 127
128#define TRACE_BUF_SIZE 1024 128#define TRACE_BUF_SIZE 1024
129 129
130struct trace_array;
131
132struct trace_cpu {
133 struct trace_array *tr;
134 struct dentry *dir;
135 int cpu;
136};
137
130/* 138/*
131 * The CPU trace array - it consists of thousands of trace entries 139 * The CPU trace array - it consists of thousands of trace entries
132 * plus some other descriptor data: (for example which task started 140 * plus some other descriptor data: (for example which task started
133 * the trace, etc.) 141 * the trace, etc.)
134 */ 142 */
135struct trace_array_cpu { 143struct trace_array_cpu {
144 struct trace_cpu trace_cpu;
136 atomic_t disabled; 145 atomic_t disabled;
137 void *buffer_page; /* ring buffer spare */ 146 void *buffer_page; /* ring buffer spare */
138 147
@@ -151,6 +160,8 @@ struct trace_array_cpu {
151 char comm[TASK_COMM_LEN]; 160 char comm[TASK_COMM_LEN];
152}; 161};
153 162
163struct tracer;
164
154/* 165/*
155 * The trace array - an array of per-CPU trace arrays. This is the 166 * The trace array - an array of per-CPU trace arrays. This is the
156 * highest level data structure that individual tracers deal with. 167 * highest level data structure that individual tracers deal with.
@@ -161,9 +172,16 @@ struct trace_array {
161 struct list_head list; 172 struct list_head list;
162 int cpu; 173 int cpu;
163 int buffer_disabled; 174 int buffer_disabled;
175 struct trace_cpu trace_cpu; /* place holder */
176 int stop_count;
177 int clock_id;
178 struct tracer *current_trace;
164 unsigned int flags; 179 unsigned int flags;
165 cycle_t time_start; 180 cycle_t time_start;
181 raw_spinlock_t start_lock;
166 struct dentry *dir; 182 struct dentry *dir;
183 struct dentry *options;
184 struct dentry *percpu_dir;
167 struct dentry *event_dir; 185 struct dentry *event_dir;
168 struct list_head systems; 186 struct list_head systems;
169 struct list_head events; 187 struct list_head events;
@@ -474,6 +492,7 @@ struct dentry *trace_create_file(const char *name,
474 void *data, 492 void *data,
475 const struct file_operations *fops); 493 const struct file_operations *fops);
476 494
495struct dentry *tracing_init_dentry_tr(struct trace_array *tr);
477struct dentry *tracing_init_dentry(void); 496struct dentry *tracing_init_dentry(void);
478 497
479struct ring_buffer_event; 498struct ring_buffer_event;
@@ -979,7 +998,7 @@ extern const char *__stop___trace_bprintk_fmt[];
979void trace_printk_init_buffers(void); 998void trace_printk_init_buffers(void);
980void trace_printk_start_comm(void); 999void trace_printk_start_comm(void);
981int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set); 1000int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set);
982int set_tracer_flag(unsigned int mask, int enabled); 1001int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled);
983 1002
984#undef FTRACE_ENTRY 1003#undef FTRACE_ENTRY
985#define FTRACE_ENTRY(call, struct_name, id, tstruct, print, filter) \ 1004#define FTRACE_ENTRY(call, struct_name, id, tstruct, print, filter) \