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