Frederic Weisbecker | 3f5ec13 | 2008-11-11 23:21:31 +0100 | [diff] [blame] | 1 | #ifndef _LINUX_TRACE_BOOT_H |
| 2 | #define _LINUX_TRACE_BOOT_H |
| 3 | |
| 4 | /* |
Frederic Weisbecker | 7423907 | 2008-11-11 23:24:42 +0100 | [diff] [blame] | 5 | * Structure which defines the trace of an initcall |
| 6 | * while it is called. |
Frederic Weisbecker | 3f5ec13 | 2008-11-11 23:21:31 +0100 | [diff] [blame] | 7 | * You don't have to fill the func field since it is |
| 8 | * only used internally by the tracer. |
| 9 | */ |
Frederic Weisbecker | 7423907 | 2008-11-11 23:24:42 +0100 | [diff] [blame] | 10 | struct boot_trace_call { |
Frederic Weisbecker | 3f5ec13 | 2008-11-11 23:21:31 +0100 | [diff] [blame] | 11 | pid_t caller; |
Stephen Rothwell | 8001530 | 2008-12-11 16:10:08 +0100 | [diff] [blame^] | 12 | char func[KSYM_SYMBOL_LEN]; |
Frederic Weisbecker | 7423907 | 2008-11-11 23:24:42 +0100 | [diff] [blame] | 13 | }; |
| 14 | |
| 15 | /* |
| 16 | * Structure which defines the trace of an initcall |
| 17 | * while it returns. |
| 18 | */ |
| 19 | struct boot_trace_ret { |
Stephen Rothwell | 8001530 | 2008-12-11 16:10:08 +0100 | [diff] [blame^] | 20 | char func[KSYM_SYMBOL_LEN]; |
Frederic Weisbecker | 7423907 | 2008-11-11 23:24:42 +0100 | [diff] [blame] | 21 | int result; |
| 22 | unsigned long long duration; /* nsecs */ |
Frederic Weisbecker | 3f5ec13 | 2008-11-11 23:21:31 +0100 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | #ifdef CONFIG_BOOT_TRACER |
Frederic Weisbecker | 7423907 | 2008-11-11 23:24:42 +0100 | [diff] [blame] | 26 | /* Append the traces on the ring-buffer */ |
| 27 | extern void trace_boot_call(struct boot_trace_call *bt, initcall_t fn); |
| 28 | extern void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn); |
Frederic Weisbecker | 3f5ec13 | 2008-11-11 23:21:31 +0100 | [diff] [blame] | 29 | |
| 30 | /* Tells the tracer that smp_pre_initcall is finished. |
| 31 | * So we can start the tracing |
| 32 | */ |
| 33 | extern void start_boot_trace(void); |
| 34 | |
| 35 | /* Resume the tracing of other necessary events |
| 36 | * such as sched switches |
| 37 | */ |
| 38 | extern void enable_boot_trace(void); |
| 39 | |
| 40 | /* Suspend this tracing. Actually, only sched_switches tracing have |
| 41 | * to be suspended. Initcalls doesn't need it.) |
| 42 | */ |
| 43 | extern void disable_boot_trace(void); |
| 44 | #else |
Frederic Weisbecker | 7423907 | 2008-11-11 23:24:42 +0100 | [diff] [blame] | 45 | static inline |
| 46 | void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) { } |
| 47 | |
| 48 | static inline |
| 49 | void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn) { } |
| 50 | |
Frederic Weisbecker | 3f5ec13 | 2008-11-11 23:21:31 +0100 | [diff] [blame] | 51 | static inline void start_boot_trace(void) { } |
| 52 | static inline void enable_boot_trace(void) { } |
| 53 | static inline void disable_boot_trace(void) { } |
| 54 | #endif /* CONFIG_BOOT_TRACER */ |
| 55 | |
| 56 | #endif /* __LINUX_TRACE_BOOT_H */ |