rv.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM rv
  4. #if !defined(_TRACE_RV_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_RV_H
  6. #include <linux/rv.h>
  7. #include <linux/tracepoint.h>
  8. #ifdef CONFIG_DA_MON_EVENTS_IMPLICIT
  9. DECLARE_EVENT_CLASS(event_da_monitor,
  10. TP_PROTO(char *state, char *event, char *next_state, bool final_state),
  11. TP_ARGS(state, event, next_state, final_state),
  12. TP_STRUCT__entry(
  13. __array( char, state, MAX_DA_NAME_LEN )
  14. __array( char, event, MAX_DA_NAME_LEN )
  15. __array( char, next_state, MAX_DA_NAME_LEN )
  16. __field( bool, final_state )
  17. ),
  18. TP_fast_assign(
  19. memcpy(__entry->state, state, MAX_DA_NAME_LEN);
  20. memcpy(__entry->event, event, MAX_DA_NAME_LEN);
  21. memcpy(__entry->next_state, next_state, MAX_DA_NAME_LEN);
  22. __entry->final_state = final_state;
  23. ),
  24. TP_printk("%s x %s -> %s %s",
  25. __entry->state,
  26. __entry->event,
  27. __entry->next_state,
  28. __entry->final_state ? "(final)" : "")
  29. );
  30. DECLARE_EVENT_CLASS(error_da_monitor,
  31. TP_PROTO(char *state, char *event),
  32. TP_ARGS(state, event),
  33. TP_STRUCT__entry(
  34. __array( char, state, MAX_DA_NAME_LEN )
  35. __array( char, event, MAX_DA_NAME_LEN )
  36. ),
  37. TP_fast_assign(
  38. memcpy(__entry->state, state, MAX_DA_NAME_LEN);
  39. memcpy(__entry->event, event, MAX_DA_NAME_LEN);
  40. ),
  41. TP_printk("event %s not expected in the state %s",
  42. __entry->event,
  43. __entry->state)
  44. );
  45. #ifdef CONFIG_RV_MON_WIP
  46. DEFINE_EVENT(event_da_monitor, event_wip,
  47. TP_PROTO(char *state, char *event, char *next_state, bool final_state),
  48. TP_ARGS(state, event, next_state, final_state));
  49. DEFINE_EVENT(error_da_monitor, error_wip,
  50. TP_PROTO(char *state, char *event),
  51. TP_ARGS(state, event));
  52. #endif /* CONFIG_RV_MON_WIP */
  53. #endif /* CONFIG_DA_MON_EVENTS_IMPLICIT */
  54. #ifdef CONFIG_DA_MON_EVENTS_ID
  55. DECLARE_EVENT_CLASS(event_da_monitor_id,
  56. TP_PROTO(int id, char *state, char *event, char *next_state, bool final_state),
  57. TP_ARGS(id, state, event, next_state, final_state),
  58. TP_STRUCT__entry(
  59. __field( int, id )
  60. __array( char, state, MAX_DA_NAME_LEN )
  61. __array( char, event, MAX_DA_NAME_LEN )
  62. __array( char, next_state, MAX_DA_NAME_LEN )
  63. __field( bool, final_state )
  64. ),
  65. TP_fast_assign(
  66. memcpy(__entry->state, state, MAX_DA_NAME_LEN);
  67. memcpy(__entry->event, event, MAX_DA_NAME_LEN);
  68. memcpy(__entry->next_state, next_state, MAX_DA_NAME_LEN);
  69. __entry->id = id;
  70. __entry->final_state = final_state;
  71. ),
  72. TP_printk("%d: %s x %s -> %s %s",
  73. __entry->id,
  74. __entry->state,
  75. __entry->event,
  76. __entry->next_state,
  77. __entry->final_state ? "(final)" : "")
  78. );
  79. DECLARE_EVENT_CLASS(error_da_monitor_id,
  80. TP_PROTO(int id, char *state, char *event),
  81. TP_ARGS(id, state, event),
  82. TP_STRUCT__entry(
  83. __field( int, id )
  84. __array( char, state, MAX_DA_NAME_LEN )
  85. __array( char, event, MAX_DA_NAME_LEN )
  86. ),
  87. TP_fast_assign(
  88. memcpy(__entry->state, state, MAX_DA_NAME_LEN);
  89. memcpy(__entry->event, event, MAX_DA_NAME_LEN);
  90. __entry->id = id;
  91. ),
  92. TP_printk("%d: event %s not expected in the state %s",
  93. __entry->id,
  94. __entry->event,
  95. __entry->state)
  96. );
  97. #ifdef CONFIG_RV_MON_WWNR
  98. /* id is the pid of the task */
  99. DEFINE_EVENT(event_da_monitor_id, event_wwnr,
  100. TP_PROTO(int id, char *state, char *event, char *next_state, bool final_state),
  101. TP_ARGS(id, state, event, next_state, final_state));
  102. DEFINE_EVENT(error_da_monitor_id, error_wwnr,
  103. TP_PROTO(int id, char *state, char *event),
  104. TP_ARGS(id, state, event));
  105. #endif /* CONFIG_RV_MON_WWNR */
  106. #endif /* CONFIG_DA_MON_EVENTS_ID */
  107. #endif /* _TRACE_RV_H */
  108. /* This part ust be outside protection */
  109. #undef TRACE_INCLUDE_PATH
  110. #include <trace/define_trace.h>