2008-11-11 23:21:31 +01:00
|
|
|
#ifndef _LINUX_TRACE_BOOT_H
|
|
|
|
#define _LINUX_TRACE_BOOT_H
|
|
|
|
|
|
|
|
/*
|
2008-11-11 23:24:42 +01:00
|
|
|
* Structure which defines the trace of an initcall
|
|
|
|
* while it is called.
|
2008-11-11 23:21:31 +01:00
|
|
|
* You don't have to fill the func field since it is
|
|
|
|
* only used internally by the tracer.
|
|
|
|
*/
|
2008-11-11 23:24:42 +01:00
|
|
|
struct boot_trace_call {
|
2008-11-11 23:21:31 +01:00
|
|
|
pid_t caller;
|
2008-12-11 16:10:08 +01:00
|
|
|
char func[KSYM_SYMBOL_LEN];
|
2008-11-11 23:24:42 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Structure which defines the trace of an initcall
|
|
|
|
* while it returns.
|
|
|
|
*/
|
|
|
|
struct boot_trace_ret {
|
2008-12-11 16:10:08 +01:00
|
|
|
char func[KSYM_SYMBOL_LEN];
|
2008-11-11 23:24:42 +01:00
|
|
|
int result;
|
|
|
|
unsigned long long duration; /* nsecs */
|
2008-11-11 23:21:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef CONFIG_BOOT_TRACER
|
2008-11-11 23:24:42 +01:00
|
|
|
/* Append the traces on the ring-buffer */
|
|
|
|
extern void trace_boot_call(struct boot_trace_call *bt, initcall_t fn);
|
|
|
|
extern void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn);
|
2008-11-11 23:21:31 +01:00
|
|
|
|
|
|
|
/* Tells the tracer that smp_pre_initcall is finished.
|
|
|
|
* So we can start the tracing
|
|
|
|
*/
|
|
|
|
extern void start_boot_trace(void);
|
|
|
|
|
|
|
|
/* Resume the tracing of other necessary events
|
|
|
|
* such as sched switches
|
|
|
|
*/
|
|
|
|
extern void enable_boot_trace(void);
|
|
|
|
|
|
|
|
/* Suspend this tracing. Actually, only sched_switches tracing have
|
|
|
|
* to be suspended. Initcalls doesn't need it.)
|
|
|
|
*/
|
|
|
|
extern void disable_boot_trace(void);
|
|
|
|
#else
|
2008-11-11 23:24:42 +01:00
|
|
|
static inline
|
|
|
|
void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) { }
|
|
|
|
|
|
|
|
static inline
|
|
|
|
void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn) { }
|
|
|
|
|
2008-11-11 23:21:31 +01:00
|
|
|
static inline void start_boot_trace(void) { }
|
|
|
|
static inline void enable_boot_trace(void) { }
|
|
|
|
static inline void disable_boot_trace(void) { }
|
|
|
|
#endif /* CONFIG_BOOT_TRACER */
|
|
|
|
|
|
|
|
#endif /* __LINUX_TRACE_BOOT_H */
|