rcu.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM rcu
  3. #if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_RCU_H
  5. #include <linux/tracepoint.h>
  6. /*
  7. * Tracepoint for start/end markers used for utilization calculations.
  8. * By convention, the string is of the following forms:
  9. *
  10. * "Start <activity>" -- Mark the start of the specified activity,
  11. * such as "context switch". Nesting is permitted.
  12. * "End <activity>" -- Mark the end of the specified activity.
  13. */
  14. TRACE_EVENT(rcu_utilization,
  15. TP_PROTO(char *s),
  16. TP_ARGS(s),
  17. TP_STRUCT__entry(
  18. __field(char *, s)
  19. ),
  20. TP_fast_assign(
  21. __entry->s = s;
  22. ),
  23. TP_printk("%s", __entry->s)
  24. );
  25. /*
  26. * Tracepoint for marking the beginning rcu_do_batch, performed to start
  27. * RCU callback invocation. The first argument is the RCU flavor,
  28. * the second is the total number of callbacks (including those that
  29. * are not yet ready to be invoked), and the third argument is the
  30. * current RCU-callback batch limit.
  31. */
  32. TRACE_EVENT(rcu_batch_start,
  33. TP_PROTO(char *rcuname, long qlen, int blimit),
  34. TP_ARGS(rcuname, qlen, blimit),
  35. TP_STRUCT__entry(
  36. __field(char *, rcuname)
  37. __field(long, qlen)
  38. __field(int, blimit)
  39. ),
  40. TP_fast_assign(
  41. __entry->rcuname = rcuname;
  42. __entry->qlen = qlen;
  43. __entry->blimit = blimit;
  44. ),
  45. TP_printk("%s CBs=%ld bl=%d",
  46. __entry->rcuname, __entry->qlen, __entry->blimit)
  47. );
  48. /*
  49. * Tracepoint for the invocation of a single RCU callback function.
  50. * The argument is a pointer to the RCU callback itself.
  51. */
  52. TRACE_EVENT(rcu_invoke_callback,
  53. TP_PROTO(struct rcu_head *rhp),
  54. TP_ARGS(rhp),
  55. TP_STRUCT__entry(
  56. __field(void *, rhp)
  57. __field(void *, func)
  58. ),
  59. TP_fast_assign(
  60. __entry->rhp = rhp;
  61. __entry->func = rhp->func;
  62. ),
  63. TP_printk("rhp=%p func=%pf", __entry->rhp, __entry->func)
  64. );
  65. /*
  66. * Tracepoint for the invocation of a single RCU callback of the special
  67. * kfree() form. The first argument is a pointer to the RCU callback
  68. * and the second argument is the offset of the callback within the
  69. * enclosing RCU-protected data structure.
  70. */
  71. TRACE_EVENT(rcu_invoke_kfree_callback,
  72. TP_PROTO(struct rcu_head *rhp, unsigned long offset),
  73. TP_ARGS(rhp, offset),
  74. TP_STRUCT__entry(
  75. __field(void *, rhp)
  76. __field(unsigned long, offset)
  77. ),
  78. TP_fast_assign(
  79. __entry->rhp = rhp;
  80. __entry->offset = offset;
  81. ),
  82. TP_printk("rhp=%p func=%ld", __entry->rhp, __entry->offset)
  83. );
  84. /*
  85. * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
  86. * invoked. The first argument is the name of the RCU flavor and
  87. * the second argument is number of callbacks actually invoked.
  88. */
  89. TRACE_EVENT(rcu_batch_end,
  90. TP_PROTO(char *rcuname, int callbacks_invoked),
  91. TP_ARGS(rcuname, callbacks_invoked),
  92. TP_STRUCT__entry(
  93. __field(char *, rcuname)
  94. __field(int, callbacks_invoked)
  95. ),
  96. TP_fast_assign(
  97. __entry->rcuname = rcuname;
  98. __entry->callbacks_invoked = callbacks_invoked;
  99. ),
  100. TP_printk("%s CBs-invoked=%d",
  101. __entry->rcuname, __entry->callbacks_invoked)
  102. );
  103. #endif /* _TRACE_RCU_H */
  104. /* This part must be outside protection */
  105. #include <trace/define_trace.h>