preemptirq.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifdef CONFIG_PREEMPTIRQ_TRACEPOINTS
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM preemptirq
  4. #if !defined(_TRACE_PREEMPTIRQ_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_PREEMPTIRQ_H
  6. #include <linux/ktime.h>
  7. #include <linux/tracepoint.h>
  8. #include <linux/string.h>
  9. #include <asm/sections.h>
  10. DECLARE_EVENT_CLASS(preemptirq_template,
  11. TP_PROTO(unsigned long ip, unsigned long parent_ip),
  12. TP_ARGS(ip, parent_ip),
  13. TP_STRUCT__entry(
  14. __field(s32, caller_offs)
  15. __field(s32, parent_offs)
  16. ),
  17. TP_fast_assign(
  18. __entry->caller_offs = (s32)(ip - (unsigned long)_stext);
  19. __entry->parent_offs = (s32)(parent_ip - (unsigned long)_stext);
  20. ),
  21. TP_printk("caller=%pF parent=%pF",
  22. (void *)((unsigned long)(_stext) + __entry->caller_offs),
  23. (void *)((unsigned long)(_stext) + __entry->parent_offs))
  24. );
  25. #ifdef CONFIG_TRACE_IRQFLAGS
  26. DEFINE_EVENT(preemptirq_template, irq_disable,
  27. TP_PROTO(unsigned long ip, unsigned long parent_ip),
  28. TP_ARGS(ip, parent_ip));
  29. DEFINE_EVENT(preemptirq_template, irq_enable,
  30. TP_PROTO(unsigned long ip, unsigned long parent_ip),
  31. TP_ARGS(ip, parent_ip));
  32. #else
  33. #define trace_irq_enable(...)
  34. #define trace_irq_disable(...)
  35. #define trace_irq_enable_rcuidle(...)
  36. #define trace_irq_disable_rcuidle(...)
  37. #endif
  38. #ifdef CONFIG_TRACE_PREEMPT_TOGGLE
  39. DEFINE_EVENT(preemptirq_template, preempt_disable,
  40. TP_PROTO(unsigned long ip, unsigned long parent_ip),
  41. TP_ARGS(ip, parent_ip));
  42. DEFINE_EVENT(preemptirq_template, preempt_enable,
  43. TP_PROTO(unsigned long ip, unsigned long parent_ip),
  44. TP_ARGS(ip, parent_ip));
  45. #else
  46. #define trace_preempt_enable(...)
  47. #define trace_preempt_disable(...)
  48. #define trace_preempt_enable_rcuidle(...)
  49. #define trace_preempt_disable_rcuidle(...)
  50. #endif
  51. #endif /* _TRACE_PREEMPTIRQ_H */
  52. #include <trace/define_trace.h>
  53. #else /* !CONFIG_PREEMPTIRQ_TRACEPOINTS */
  54. #define trace_irq_enable(...)
  55. #define trace_irq_disable(...)
  56. #define trace_irq_enable_rcuidle(...)
  57. #define trace_irq_disable_rcuidle(...)
  58. #define trace_preempt_enable(...)
  59. #define trace_preempt_disable(...)
  60. #define trace_preempt_enable_rcuidle(...)
  61. #define trace_preempt_disable_rcuidle(...)
  62. #endif