diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-05 14:04:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-05 14:04:19 -0400 |
commit | 714f83d5d9f7c785f622259dad1f4fad12d64664 (patch) | |
tree | 20563541ae438e11d686b4d629074eb002a481b7 /kernel/trace/trace_boot.c | |
parent | 8901e7ffc2fa78ede7ce9826dbad68a3a25dc2dc (diff) | |
parent | 645dae969c3b8651c5bc7c54a1835ec03820f85f (diff) |
Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (413 commits)
tracing, net: fix net tree and tracing tree merge interaction
tracing, powerpc: fix powerpc tree and tracing tree interaction
ring-buffer: do not remove reader page from list on ring buffer free
function-graph: allow unregistering twice
trace: make argument 'mem' of trace_seq_putmem() const
tracing: add missing 'extern' keywords to trace_output.h
tracing: provide trace_seq_reserve()
blktrace: print out BLK_TN_MESSAGE properly
blktrace: extract duplidate code
blktrace: fix memory leak when freeing struct blk_io_trace
blktrace: fix blk_probes_ref chaos
blktrace: make classic output more classic
blktrace: fix off-by-one bug
blktrace: fix the original blktrace
blktrace: fix a race when creating blk_tree_root in debugfs
blktrace: fix timestamp in binary output
tracing, Text Edit Lock: cleanup
tracing: filter fix for TRACE_EVENT_FORMAT events
ftrace: Using FTRACE_WARN_ON() to check "freed record" in ftrace_release()
x86: kretprobe-booster interrupt emulation code fix
...
Fix up trivial conflicts in
arch/parisc/include/asm/ftrace.h
include/linux/memory.h
kernel/extable.c
kernel/module.c
Diffstat (limited to 'kernel/trace/trace_boot.c')
-rw-r--r-- | kernel/trace/trace_boot.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c index 366c8c333e13..7a30fc4c3642 100644 --- a/kernel/trace/trace_boot.c +++ b/kernel/trace/trace_boot.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/kallsyms.h> | 11 | #include <linux/kallsyms.h> |
12 | 12 | ||
13 | #include "trace.h" | 13 | #include "trace.h" |
14 | #include "trace_output.h" | ||
14 | 15 | ||
15 | static struct trace_array *boot_trace; | 16 | static struct trace_array *boot_trace; |
16 | static bool pre_initcalls_finished; | 17 | static bool pre_initcalls_finished; |
@@ -27,13 +28,13 @@ void start_boot_trace(void) | |||
27 | 28 | ||
28 | void enable_boot_trace(void) | 29 | void enable_boot_trace(void) |
29 | { | 30 | { |
30 | if (pre_initcalls_finished) | 31 | if (boot_trace && pre_initcalls_finished) |
31 | tracing_start_sched_switch_record(); | 32 | tracing_start_sched_switch_record(); |
32 | } | 33 | } |
33 | 34 | ||
34 | void disable_boot_trace(void) | 35 | void disable_boot_trace(void) |
35 | { | 36 | { |
36 | if (pre_initcalls_finished) | 37 | if (boot_trace && pre_initcalls_finished) |
37 | tracing_stop_sched_switch_record(); | 38 | tracing_stop_sched_switch_record(); |
38 | } | 39 | } |
39 | 40 | ||
@@ -42,6 +43,9 @@ static int boot_trace_init(struct trace_array *tr) | |||
42 | int cpu; | 43 | int cpu; |
43 | boot_trace = tr; | 44 | boot_trace = tr; |
44 | 45 | ||
46 | if (!tr) | ||
47 | return 0; | ||
48 | |||
45 | for_each_cpu(cpu, cpu_possible_mask) | 49 | for_each_cpu(cpu, cpu_possible_mask) |
46 | tracing_reset(tr, cpu); | 50 | tracing_reset(tr, cpu); |
47 | 51 | ||
@@ -128,10 +132,9 @@ void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) | |||
128 | { | 132 | { |
129 | struct ring_buffer_event *event; | 133 | struct ring_buffer_event *event; |
130 | struct trace_boot_call *entry; | 134 | struct trace_boot_call *entry; |
131 | unsigned long irq_flags; | ||
132 | struct trace_array *tr = boot_trace; | 135 | struct trace_array *tr = boot_trace; |
133 | 136 | ||
134 | if (!pre_initcalls_finished) | 137 | if (!tr || !pre_initcalls_finished) |
135 | return; | 138 | return; |
136 | 139 | ||
137 | /* Get its name now since this function could | 140 | /* Get its name now since this function could |
@@ -140,18 +143,13 @@ void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) | |||
140 | sprint_symbol(bt->func, (unsigned long)fn); | 143 | sprint_symbol(bt->func, (unsigned long)fn); |
141 | preempt_disable(); | 144 | preempt_disable(); |
142 | 145 | ||
143 | event = ring_buffer_lock_reserve(tr->buffer, sizeof(*entry), | 146 | event = trace_buffer_lock_reserve(tr, TRACE_BOOT_CALL, |
144 | &irq_flags); | 147 | sizeof(*entry), 0, 0); |
145 | if (!event) | 148 | if (!event) |
146 | goto out; | 149 | goto out; |
147 | entry = ring_buffer_event_data(event); | 150 | entry = ring_buffer_event_data(event); |
148 | tracing_generic_entry_update(&entry->ent, 0, 0); | ||
149 | entry->ent.type = TRACE_BOOT_CALL; | ||
150 | entry->boot_call = *bt; | 151 | entry->boot_call = *bt; |
151 | ring_buffer_unlock_commit(tr->buffer, event, irq_flags); | 152 | trace_buffer_unlock_commit(tr, event, 0, 0); |
152 | |||
153 | trace_wake_up(); | ||
154 | |||
155 | out: | 153 | out: |
156 | preempt_enable(); | 154 | preempt_enable(); |
157 | } | 155 | } |
@@ -160,27 +158,21 @@ void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn) | |||
160 | { | 158 | { |
161 | struct ring_buffer_event *event; | 159 | struct ring_buffer_event *event; |
162 | struct trace_boot_ret *entry; | 160 | struct trace_boot_ret *entry; |
163 | unsigned long irq_flags; | ||
164 | struct trace_array *tr = boot_trace; | 161 | struct trace_array *tr = boot_trace; |
165 | 162 | ||
166 | if (!pre_initcalls_finished) | 163 | if (!tr || !pre_initcalls_finished) |
167 | return; | 164 | return; |
168 | 165 | ||
169 | sprint_symbol(bt->func, (unsigned long)fn); | 166 | sprint_symbol(bt->func, (unsigned long)fn); |
170 | preempt_disable(); | 167 | preempt_disable(); |
171 | 168 | ||
172 | event = ring_buffer_lock_reserve(tr->buffer, sizeof(*entry), | 169 | event = trace_buffer_lock_reserve(tr, TRACE_BOOT_RET, |
173 | &irq_flags); | 170 | sizeof(*entry), 0, 0); |
174 | if (!event) | 171 | if (!event) |
175 | goto out; | 172 | goto out; |
176 | entry = ring_buffer_event_data(event); | 173 | entry = ring_buffer_event_data(event); |
177 | tracing_generic_entry_update(&entry->ent, 0, 0); | ||
178 | entry->ent.type = TRACE_BOOT_RET; | ||
179 | entry->boot_ret = *bt; | 174 | entry->boot_ret = *bt; |
180 | ring_buffer_unlock_commit(tr->buffer, event, irq_flags); | 175 | trace_buffer_unlock_commit(tr, event, 0, 0); |
181 | |||
182 | trace_wake_up(); | ||
183 | |||
184 | out: | 176 | out: |
185 | preempt_enable(); | 177 | preempt_enable(); |
186 | } | 178 | } |