diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2008-11-11 17:21:31 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-12 04:17:18 -0500 |
commit | 3f5ec13696fd4a33bde42f385406cbb1d3cc96fd (patch) | |
tree | 3c705c5991fcf0f4968ff790bb2e2ce65c8cbf18 | |
parent | 60a011c736e7dd09a0b01ca6a051a416f3f52ffb (diff) |
tracing/fastboot: move boot tracer structs and funcs into their own header.
Impact: Cleanups on the boot tracer and ftrace
This patch bring some cleanups about the boot tracer headers. The
functions and structures of this tracer have nothing related to ftrace
and should have so their own header file.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/linux/ftrace.h | 41 | ||||
-rw-r--r-- | include/trace/boot.h | 43 | ||||
-rw-r--r-- | init/main.c | 1 | ||||
-rw-r--r-- | kernel/trace/trace.h | 1 |
4 files changed, 45 insertions, 41 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index dcbbf72a88b1..4fbc4a8b86a5 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -287,45 +287,4 @@ extern trace_function_return_t ftrace_function_return; | |||
287 | extern void unregister_ftrace_return(void); | 287 | extern void unregister_ftrace_return(void); |
288 | #endif | 288 | #endif |
289 | 289 | ||
290 | /* | ||
291 | * Structure which defines the trace of an initcall. | ||
292 | * You don't have to fill the func field since it is | ||
293 | * only used internally by the tracer. | ||
294 | */ | ||
295 | struct boot_trace { | ||
296 | pid_t caller; | ||
297 | char func[KSYM_NAME_LEN]; | ||
298 | int result; | ||
299 | unsigned long long duration; /* usecs */ | ||
300 | ktime_t calltime; | ||
301 | ktime_t rettime; | ||
302 | }; | ||
303 | |||
304 | #ifdef CONFIG_BOOT_TRACER | ||
305 | /* Append the trace on the ring-buffer */ | ||
306 | extern void trace_boot(struct boot_trace *it, initcall_t fn); | ||
307 | |||
308 | /* Tells the tracer that smp_pre_initcall is finished. | ||
309 | * So we can start the tracing | ||
310 | */ | ||
311 | extern void start_boot_trace(void); | ||
312 | |||
313 | /* Resume the tracing of other necessary events | ||
314 | * such as sched switches | ||
315 | */ | ||
316 | extern void enable_boot_trace(void); | ||
317 | |||
318 | /* Suspend this tracing. Actually, only sched_switches tracing have | ||
319 | * to be suspended. Initcalls doesn't need it.) | ||
320 | */ | ||
321 | extern void disable_boot_trace(void); | ||
322 | #else | ||
323 | static inline void trace_boot(struct boot_trace *it, initcall_t fn) { } | ||
324 | static inline void start_boot_trace(void) { } | ||
325 | static inline void enable_boot_trace(void) { } | ||
326 | static inline void disable_boot_trace(void) { } | ||
327 | #endif | ||
328 | |||
329 | |||
330 | |||
331 | #endif /* _LINUX_FTRACE_H */ | 290 | #endif /* _LINUX_FTRACE_H */ |
diff --git a/include/trace/boot.h b/include/trace/boot.h new file mode 100644 index 000000000000..4cbe64e46cdc --- /dev/null +++ b/include/trace/boot.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef _LINUX_TRACE_BOOT_H | ||
2 | #define _LINUX_TRACE_BOOT_H | ||
3 | |||
4 | /* | ||
5 | * Structure which defines the trace of an initcall. | ||
6 | * You don't have to fill the func field since it is | ||
7 | * only used internally by the tracer. | ||
8 | */ | ||
9 | struct boot_trace { | ||
10 | pid_t caller; | ||
11 | char func[KSYM_NAME_LEN]; | ||
12 | int result; | ||
13 | unsigned long long duration; /* usecs */ | ||
14 | ktime_t calltime; | ||
15 | ktime_t rettime; | ||
16 | }; | ||
17 | |||
18 | #ifdef CONFIG_BOOT_TRACER | ||
19 | /* Append the trace on the ring-buffer */ | ||
20 | extern void trace_boot(struct boot_trace *it, initcall_t fn); | ||
21 | |||
22 | /* Tells the tracer that smp_pre_initcall is finished. | ||
23 | * So we can start the tracing | ||
24 | */ | ||
25 | extern void start_boot_trace(void); | ||
26 | |||
27 | /* Resume the tracing of other necessary events | ||
28 | * such as sched switches | ||
29 | */ | ||
30 | extern void enable_boot_trace(void); | ||
31 | |||
32 | /* Suspend this tracing. Actually, only sched_switches tracing have | ||
33 | * to be suspended. Initcalls doesn't need it.) | ||
34 | */ | ||
35 | extern void disable_boot_trace(void); | ||
36 | #else | ||
37 | static inline void trace_boot(struct boot_trace *it, initcall_t fn) { } | ||
38 | static inline void start_boot_trace(void) { } | ||
39 | static inline void enable_boot_trace(void) { } | ||
40 | static inline void disable_boot_trace(void) { } | ||
41 | #endif /* CONFIG_BOOT_TRACER */ | ||
42 | |||
43 | #endif /* __LINUX_TRACE_BOOT_H */ | ||
diff --git a/init/main.c b/init/main.c index 4b03cd5656ca..16ca1ee071c4 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include <linux/signal.h> | 63 | #include <linux/signal.h> |
64 | #include <linux/idr.h> | 64 | #include <linux/idr.h> |
65 | #include <linux/ftrace.h> | 65 | #include <linux/ftrace.h> |
66 | #include <trace/boot.h> | ||
66 | 67 | ||
67 | #include <asm/io.h> | 68 | #include <asm/io.h> |
68 | #include <asm/bugs.h> | 69 | #include <asm/bugs.h> |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index e40ce0c14690..f69a5199596b 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/ring_buffer.h> | 8 | #include <linux/ring_buffer.h> |
9 | #include <linux/mmiotrace.h> | 9 | #include <linux/mmiotrace.h> |
10 | #include <linux/ftrace.h> | 10 | #include <linux/ftrace.h> |
11 | #include <trace/boot.h> | ||
11 | 12 | ||
12 | enum trace_type { | 13 | enum trace_type { |
13 | __TRACE_FIRST_TYPE = 0, | 14 | __TRACE_FIRST_TYPE = 0, |