aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-09-29 23:02:41 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-14 04:38:57 -0400
commit3928a8a2d98081d1bc3c0a84a2d70e29b90ecf1c (patch)
tree5c1fd6fd721e2e9a5c47facfd50fbc011b3db53a /kernel/trace/trace.h
parented56829cb3195de499f97fa6108fe9134319bae6 (diff)
ftrace: make work with new ring buffer
This patch ports ftrace over to the new ring buffer. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h22
1 files changed, 5 insertions, 17 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index b28bf8812efc..f6965f775b43 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -5,6 +5,7 @@
5#include <asm/atomic.h> 5#include <asm/atomic.h>
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/clocksource.h> 7#include <linux/clocksource.h>
8#include <linux/ring_buffer.h>
8#include <linux/mmiotrace.h> 9#include <linux/mmiotrace.h>
9#include <linux/ftrace.h> 10#include <linux/ftrace.h>
10 11
@@ -102,7 +103,6 @@ struct trace_field {
102 char flags; 103 char flags;
103 char preempt_count; 104 char preempt_count;
104 int pid; 105 int pid;
105 cycle_t t;
106 union { 106 union {
107 struct ftrace_entry fn; 107 struct ftrace_entry fn;
108 struct ctx_switch_entry ctx; 108 struct ctx_switch_entry ctx;
@@ -139,16 +139,9 @@ struct trace_entry {
139 * the trace, etc.) 139 * the trace, etc.)
140 */ 140 */
141struct trace_array_cpu { 141struct trace_array_cpu {
142 struct list_head trace_pages;
143 atomic_t disabled; 142 atomic_t disabled;
144 raw_spinlock_t lock;
145 struct lock_class_key lock_key;
146 143
147 /* these fields get copied into max-trace: */ 144 /* these fields get copied into max-trace: */
148 unsigned trace_head_idx;
149 unsigned trace_tail_idx;
150 void *trace_head; /* producer */
151 void *trace_tail; /* consumer */
152 unsigned long trace_idx; 145 unsigned long trace_idx;
153 unsigned long overrun; 146 unsigned long overrun;
154 unsigned long saved_latency; 147 unsigned long saved_latency;
@@ -172,6 +165,7 @@ struct trace_iterator;
172 * They have on/off state as well: 165 * They have on/off state as well:
173 */ 166 */
174struct trace_array { 167struct trace_array {
168 struct ring_buffer *buffer;
175 unsigned long entries; 169 unsigned long entries;
176 long ctrl; 170 long ctrl;
177 int cpu; 171 int cpu;
@@ -219,27 +213,21 @@ struct trace_iterator {
219 struct trace_array *tr; 213 struct trace_array *tr;
220 struct tracer *trace; 214 struct tracer *trace;
221 void *private; 215 void *private;
222 long last_overrun[NR_CPUS]; 216 struct ring_buffer_iter *buffer_iter[NR_CPUS];
223 long overrun[NR_CPUS];
224 217
225 /* The below is zeroed out in pipe_read */ 218 /* The below is zeroed out in pipe_read */
226 struct trace_seq seq; 219 struct trace_seq seq;
227 struct trace_entry *ent; 220 struct trace_entry *ent;
228 int cpu; 221 int cpu;
229 222 u64 ts;
230 struct trace_entry *prev_ent;
231 int prev_cpu;
232 223
233 unsigned long iter_flags; 224 unsigned long iter_flags;
234 loff_t pos; 225 loff_t pos;
235 unsigned long next_idx[NR_CPUS];
236 struct list_head *next_page[NR_CPUS];
237 unsigned next_page_idx[NR_CPUS];
238 long idx; 226 long idx;
239}; 227};
240 228
241void trace_wake_up(void); 229void trace_wake_up(void);
242void tracing_reset(struct trace_array_cpu *data); 230void tracing_reset(struct trace_array *tr, int cpu);
243int tracing_open_generic(struct inode *inode, struct file *filp); 231int tracing_open_generic(struct inode *inode, struct file *filp);
244struct dentry *tracing_init_dentry(void); 232struct dentry *tracing_init_dentry(void);
245void init_tracer_sysprof_debugfs(struct dentry *d_tracer); 233void init_tracer_sysprof_debugfs(struct dentry *d_tracer);