aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ftrace.h41
-rw-r--r--include/trace/boot.h43
-rw-r--r--init/main.c1
-rw-r--r--kernel/trace/trace.h1
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;
287extern void unregister_ftrace_return(void); 287extern 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 */
295struct 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 */
306extern 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 */
311extern void start_boot_trace(void);
312
313/* Resume the tracing of other necessary events
314 * such as sched switches
315 */
316extern 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 */
321extern void disable_boot_trace(void);
322#else
323static inline void trace_boot(struct boot_trace *it, initcall_t fn) { }
324static inline void start_boot_trace(void) { }
325static inline void enable_boot_trace(void) { }
326static 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 */
9struct 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 */
20extern 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 */
25extern void start_boot_trace(void);
26
27/* Resume the tracing of other necessary events
28 * such as sched switches
29 */
30extern 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 */
35extern void disable_boot_trace(void);
36#else
37static inline void trace_boot(struct boot_trace *it, initcall_t fn) { }
38static inline void start_boot_trace(void) { }
39static inline void enable_boot_trace(void) { }
40static 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
12enum trace_type { 13enum trace_type {
13 __TRACE_FIRST_TYPE = 0, 14 __TRACE_FIRST_TYPE = 0,