boot.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _LINUX_TRACE_BOOT_H
  2. #define _LINUX_TRACE_BOOT_H
  3. /*
  4. * Structure which defines the trace of an initcall
  5. * while it is called.
  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_call {
  10. pid_t caller;
  11. char func[KSYM_NAME_LEN];
  12. };
  13. /*
  14. * Structure which defines the trace of an initcall
  15. * while it returns.
  16. */
  17. struct boot_trace_ret {
  18. char func[KSYM_NAME_LEN];
  19. int result;
  20. unsigned long long duration; /* nsecs */
  21. };
  22. #ifdef CONFIG_BOOT_TRACER
  23. /* Append the traces on the ring-buffer */
  24. extern void trace_boot_call(struct boot_trace_call *bt, initcall_t fn);
  25. extern void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn);
  26. /* Tells the tracer that smp_pre_initcall is finished.
  27. * So we can start the tracing
  28. */
  29. extern void start_boot_trace(void);
  30. /* Resume the tracing of other necessary events
  31. * such as sched switches
  32. */
  33. extern void enable_boot_trace(void);
  34. /* Suspend this tracing. Actually, only sched_switches tracing have
  35. * to be suspended. Initcalls doesn't need it.)
  36. */
  37. extern void disable_boot_trace(void);
  38. #else
  39. static inline
  40. void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) { }
  41. static inline
  42. void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn) { }
  43. static inline void start_boot_trace(void) { }
  44. static inline void enable_boot_trace(void) { }
  45. static inline void disable_boot_trace(void) { }
  46. #endif /* CONFIG_BOOT_TRACER */
  47. #endif /* __LINUX_TRACE_BOOT_H */