boot.h 1.5 KB

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