rcu.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. * An "@" character within "<activity>" is a comment character: Data
  15. * reduction scripts will ignore the "@" and the remainder of the line.
  16. */
  17. TRACE_EVENT(rcu_utilization,
  18. TP_PROTO(char *s),
  19. TP_ARGS(s),
  20. TP_STRUCT__entry(
  21. __field(char *, s)
  22. ),
  23. TP_fast_assign(
  24. __entry->s = s;
  25. ),
  26. TP_printk("%s", __entry->s)
  27. );
  28. /*
  29. * Tracepoint for marking the beginning rcu_do_batch, performed to start
  30. * RCU callback invocation. The first argument is the RCU flavor,
  31. * the second is the total number of callbacks (including those that
  32. * are not yet ready to be invoked), and the third argument is the
  33. * current RCU-callback batch limit.
  34. */
  35. TRACE_EVENT(rcu_batch_start,
  36. TP_PROTO(char *rcuname, long qlen, int blimit),
  37. TP_ARGS(rcuname, qlen, blimit),
  38. TP_STRUCT__entry(
  39. __field(char *, rcuname)
  40. __field(long, qlen)
  41. __field(int, blimit)
  42. ),
  43. TP_fast_assign(
  44. __entry->rcuname = rcuname;
  45. __entry->qlen = qlen;
  46. __entry->blimit = blimit;
  47. ),
  48. TP_printk("%s CBs=%ld bl=%d",
  49. __entry->rcuname, __entry->qlen, __entry->blimit)
  50. );
  51. /*
  52. * Tracepoint for the invocation of a single RCU callback function.
  53. * The argument is a pointer to the RCU callback itself.
  54. */
  55. TRACE_EVENT(rcu_invoke_callback,
  56. TP_PROTO(struct rcu_head *rhp),
  57. TP_ARGS(rhp),
  58. TP_STRUCT__entry(
  59. __field(void *, rhp)
  60. __field(void *, func)
  61. ),
  62. TP_fast_assign(
  63. __entry->rhp = rhp;
  64. __entry->func = rhp->func;
  65. ),
  66. TP_printk("rhp=%p func=%pf", __entry->rhp, __entry->func)
  67. );
  68. /*
  69. * Tracepoint for the invocation of a single RCU callback of the special
  70. * kfree() form. The first argument is a pointer to the RCU callback
  71. * and the second argument is the offset of the callback within the
  72. * enclosing RCU-protected data structure.
  73. */
  74. TRACE_EVENT(rcu_invoke_kfree_callback,
  75. TP_PROTO(struct rcu_head *rhp, unsigned long offset),
  76. TP_ARGS(rhp, offset),
  77. TP_STRUCT__entry(
  78. __field(void *, rhp)
  79. __field(unsigned long, offset)
  80. ),
  81. TP_fast_assign(
  82. __entry->rhp = rhp;
  83. __entry->offset = offset;
  84. ),
  85. TP_printk("rhp=%p func=%ld", __entry->rhp, __entry->offset)
  86. );
  87. /*
  88. * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
  89. * invoked. The first argument is the name of the RCU flavor and
  90. * the second argument is number of callbacks actually invoked.
  91. */
  92. TRACE_EVENT(rcu_batch_end,
  93. TP_PROTO(char *rcuname, int callbacks_invoked),
  94. TP_ARGS(rcuname, callbacks_invoked),
  95. TP_STRUCT__entry(
  96. __field(char *, rcuname)
  97. __field(int, callbacks_invoked)
  98. ),
  99. TP_fast_assign(
  100. __entry->rcuname = rcuname;
  101. __entry->callbacks_invoked = callbacks_invoked;
  102. ),
  103. TP_printk("%s CBs-invoked=%d",
  104. __entry->rcuname, __entry->callbacks_invoked)
  105. );
  106. #endif /* _TRACE_RCU_H */
  107. /* This part must be outside protection */
  108. #include <trace/define_trace.h>