diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2008-09-29 23:02:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 04:38:57 -0400 |
commit | 3928a8a2d98081d1bc3c0a84a2d70e29b90ecf1c (patch) | |
tree | 5c1fd6fd721e2e9a5c47facfd50fbc011b3db53a /kernel/trace/trace_mmiotrace.c | |
parent | ed56829cb3195de499f97fa6108fe9134319bae6 (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_mmiotrace.c')
-rw-r--r-- | kernel/trace/trace_mmiotrace.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index a108c326f36e..bdbf09d8413c 100644 --- a/kernel/trace/trace_mmiotrace.c +++ b/kernel/trace/trace_mmiotrace.c | |||
@@ -27,7 +27,7 @@ static void mmio_reset_data(struct trace_array *tr) | |||
27 | tr->time_start = ftrace_now(tr->cpu); | 27 | tr->time_start = ftrace_now(tr->cpu); |
28 | 28 | ||
29 | for_each_online_cpu(cpu) | 29 | for_each_online_cpu(cpu) |
30 | tracing_reset(tr->data[cpu]); | 30 | tracing_reset(tr, cpu); |
31 | } | 31 | } |
32 | 32 | ||
33 | static void mmio_trace_init(struct trace_array *tr) | 33 | static void mmio_trace_init(struct trace_array *tr) |
@@ -130,10 +130,14 @@ static unsigned long count_overruns(struct trace_iterator *iter) | |||
130 | { | 130 | { |
131 | int cpu; | 131 | int cpu; |
132 | unsigned long cnt = 0; | 132 | unsigned long cnt = 0; |
133 | /* FIXME: */ | ||
134 | #if 0 | ||
133 | for_each_online_cpu(cpu) { | 135 | for_each_online_cpu(cpu) { |
134 | cnt += iter->overrun[cpu]; | 136 | cnt += iter->overrun[cpu]; |
135 | iter->overrun[cpu] = 0; | 137 | iter->overrun[cpu] = 0; |
136 | } | 138 | } |
139 | #endif | ||
140 | (void)cpu; | ||
137 | return cnt; | 141 | return cnt; |
138 | } | 142 | } |
139 | 143 | ||
@@ -176,7 +180,7 @@ static int mmio_print_rw(struct trace_iterator *iter) | |||
176 | struct trace_entry *entry = iter->ent; | 180 | struct trace_entry *entry = iter->ent; |
177 | struct mmiotrace_rw *rw = &entry->field.mmiorw; | 181 | struct mmiotrace_rw *rw = &entry->field.mmiorw; |
178 | struct trace_seq *s = &iter->seq; | 182 | struct trace_seq *s = &iter->seq; |
179 | unsigned long long t = ns2usecs(entry->field.t); | 183 | unsigned long long t = ns2usecs(iter->ts); |
180 | unsigned long usec_rem = do_div(t, 1000000ULL); | 184 | unsigned long usec_rem = do_div(t, 1000000ULL); |
181 | unsigned secs = (unsigned long)t; | 185 | unsigned secs = (unsigned long)t; |
182 | int ret = 1; | 186 | int ret = 1; |
@@ -218,7 +222,7 @@ static int mmio_print_map(struct trace_iterator *iter) | |||
218 | struct trace_entry *entry = iter->ent; | 222 | struct trace_entry *entry = iter->ent; |
219 | struct mmiotrace_map *m = &entry->field.mmiomap; | 223 | struct mmiotrace_map *m = &entry->field.mmiomap; |
220 | struct trace_seq *s = &iter->seq; | 224 | struct trace_seq *s = &iter->seq; |
221 | unsigned long long t = ns2usecs(entry->field.t); | 225 | unsigned long long t = ns2usecs(iter->ts); |
222 | unsigned long usec_rem = do_div(t, 1000000ULL); | 226 | unsigned long usec_rem = do_div(t, 1000000ULL); |
223 | unsigned secs = (unsigned long)t; | 227 | unsigned secs = (unsigned long)t; |
224 | int ret = 1; | 228 | int ret = 1; |
@@ -250,7 +254,7 @@ static int mmio_print_mark(struct trace_iterator *iter) | |||
250 | struct trace_entry *entry = iter->ent; | 254 | struct trace_entry *entry = iter->ent; |
251 | const char *msg = entry->field.print.buf; | 255 | const char *msg = entry->field.print.buf; |
252 | struct trace_seq *s = &iter->seq; | 256 | struct trace_seq *s = &iter->seq; |
253 | unsigned long long t = ns2usecs(entry->field.t); | 257 | unsigned long long t = ns2usecs(iter->ts); |
254 | unsigned long usec_rem = do_div(t, 1000000ULL); | 258 | unsigned long usec_rem = do_div(t, 1000000ULL); |
255 | unsigned secs = (unsigned long)t; | 259 | unsigned secs = (unsigned long)t; |
256 | int ret; | 260 | int ret; |
@@ -303,19 +307,19 @@ static void __trace_mmiotrace_rw(struct trace_array *tr, | |||
303 | struct trace_array_cpu *data, | 307 | struct trace_array_cpu *data, |
304 | struct mmiotrace_rw *rw) | 308 | struct mmiotrace_rw *rw) |
305 | { | 309 | { |
310 | struct ring_buffer_event *event; | ||
306 | struct trace_entry *entry; | 311 | struct trace_entry *entry; |
307 | unsigned long irq_flags; | 312 | unsigned long irq_flags; |
308 | 313 | ||
309 | raw_local_irq_save(irq_flags); | 314 | event = ring_buffer_lock_reserve(tr->buffer, sizeof(*entry), |
310 | __raw_spin_lock(&data->lock); | 315 | &irq_flags); |
311 | 316 | if (!event) | |
312 | entry = tracing_get_trace_entry(tr, data); | 317 | return; |
318 | entry = ring_buffer_event_data(event); | ||
313 | tracing_generic_entry_update(entry, 0); | 319 | tracing_generic_entry_update(entry, 0); |
314 | entry->type = TRACE_MMIO_RW; | 320 | entry->type = TRACE_MMIO_RW; |
315 | entry->field.mmiorw = *rw; | 321 | entry->field.mmiorw = *rw; |
316 | 322 | ring_buffer_unlock_commit(tr->buffer, event, irq_flags); | |
317 | __raw_spin_unlock(&data->lock); | ||
318 | raw_local_irq_restore(irq_flags); | ||
319 | 323 | ||
320 | trace_wake_up(); | 324 | trace_wake_up(); |
321 | } | 325 | } |
@@ -331,19 +335,19 @@ static void __trace_mmiotrace_map(struct trace_array *tr, | |||
331 | struct trace_array_cpu *data, | 335 | struct trace_array_cpu *data, |
332 | struct mmiotrace_map *map) | 336 | struct mmiotrace_map *map) |
333 | { | 337 | { |
338 | struct ring_buffer_event *event; | ||
334 | struct trace_entry *entry; | 339 | struct trace_entry *entry; |
335 | unsigned long irq_flags; | 340 | unsigned long irq_flags; |
336 | 341 | ||
337 | raw_local_irq_save(irq_flags); | 342 | event = ring_buffer_lock_reserve(tr->buffer, sizeof(*entry), |
338 | __raw_spin_lock(&data->lock); | 343 | &irq_flags); |
339 | 344 | if (!event) | |
340 | entry = tracing_get_trace_entry(tr, data); | 345 | return; |
346 | entry = ring_buffer_event_data(event); | ||
341 | tracing_generic_entry_update(entry, 0); | 347 | tracing_generic_entry_update(entry, 0); |
342 | entry->type = TRACE_MMIO_MAP; | 348 | entry->type = TRACE_MMIO_MAP; |
343 | entry->field.mmiomap = *map; | 349 | entry->field.mmiomap = *map; |
344 | 350 | ring_buffer_unlock_commit(tr->buffer, event, irq_flags); | |
345 | __raw_spin_unlock(&data->lock); | ||
346 | raw_local_irq_restore(irq_flags); | ||
347 | 351 | ||
348 | trace_wake_up(); | 352 | trace_wake_up(); |
349 | } | 353 | } |