aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_boot.c
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_boot.c
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_boot.c')
-rw-r--r--kernel/trace/trace_boot.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
index d5c9e2e4a9c4..3657eec6b87d 100644
--- a/kernel/trace/trace_boot.c
+++ b/kernel/trace/trace_boot.c
@@ -34,7 +34,7 @@ static void boot_trace_init(struct trace_array *tr)
34 trace_boot_enabled = 0; 34 trace_boot_enabled = 0;
35 35
36 for_each_cpu_mask(cpu, cpu_possible_map) 36 for_each_cpu_mask(cpu, cpu_possible_map)
37 tracing_reset(tr->data[cpu]); 37 tracing_reset(tr, cpu);
38} 38}
39 39
40static void boot_trace_ctrl_update(struct trace_array *tr) 40static void boot_trace_ctrl_update(struct trace_array *tr)
@@ -74,6 +74,7 @@ struct tracer boot_tracer __read_mostly =
74 74
75void trace_boot(struct boot_trace *it) 75void trace_boot(struct boot_trace *it)
76{ 76{
77 struct ring_buffer_event *event;
77 struct trace_entry *entry; 78 struct trace_entry *entry;
78 struct trace_array_cpu *data; 79 struct trace_array_cpu *data;
79 unsigned long irq_flags; 80 unsigned long irq_flags;
@@ -85,17 +86,18 @@ void trace_boot(struct boot_trace *it)
85 preempt_disable(); 86 preempt_disable();
86 data = tr->data[smp_processor_id()]; 87 data = tr->data[smp_processor_id()];
87 88
88 raw_local_irq_save(irq_flags); 89 event = ring_buffer_lock_reserve(tr->buffer, sizeof(*entry),
89 __raw_spin_lock(&data->lock); 90 &irq_flags);
90 91 if (!event)
91 entry = tracing_get_trace_entry(tr, data); 92 goto out;
93 entry = ring_buffer_event_data(event);
92 tracing_generic_entry_update(entry, 0); 94 tracing_generic_entry_update(entry, 0);
93 entry->type = TRACE_BOOT; 95 entry->type = TRACE_BOOT;
94 entry->field.initcall = *it; 96 entry->field.initcall = *it;
97 ring_buffer_unlock_commit(tr->buffer, event, irq_flags);
95 98
96 __raw_spin_unlock(&data->lock);
97 raw_local_irq_restore(irq_flags);
98 trace_wake_up(); 99 trace_wake_up();
99 100
101 out:
100 preempt_enable(); 102 preempt_enable();
101} 103}