0001
0002 #undef TRACE_SYSTEM
0003 #define TRACE_SYSTEM rv
0004
0005 #if !defined(_TRACE_RV_H) || defined(TRACE_HEADER_MULTI_READ)
0006 #define _TRACE_RV_H
0007
0008 #include <linux/rv.h>
0009 #include <linux/tracepoint.h>
0010
0011 #ifdef CONFIG_DA_MON_EVENTS_IMPLICIT
0012 DECLARE_EVENT_CLASS(event_da_monitor,
0013
0014 TP_PROTO(char *state, char *event, char *next_state, bool final_state),
0015
0016 TP_ARGS(state, event, next_state, final_state),
0017
0018 TP_STRUCT__entry(
0019 __array( char, state, MAX_DA_NAME_LEN )
0020 __array( char, event, MAX_DA_NAME_LEN )
0021 __array( char, next_state, MAX_DA_NAME_LEN )
0022 __field( bool, final_state )
0023 ),
0024
0025 TP_fast_assign(
0026 memcpy(__entry->state, state, MAX_DA_NAME_LEN);
0027 memcpy(__entry->event, event, MAX_DA_NAME_LEN);
0028 memcpy(__entry->next_state, next_state, MAX_DA_NAME_LEN);
0029 __entry->final_state = final_state;
0030 ),
0031
0032 TP_printk("%s x %s -> %s %s",
0033 __entry->state,
0034 __entry->event,
0035 __entry->next_state,
0036 __entry->final_state ? "(final)" : "")
0037 );
0038
0039 DECLARE_EVENT_CLASS(error_da_monitor,
0040
0041 TP_PROTO(char *state, char *event),
0042
0043 TP_ARGS(state, event),
0044
0045 TP_STRUCT__entry(
0046 __array( char, state, MAX_DA_NAME_LEN )
0047 __array( char, event, MAX_DA_NAME_LEN )
0048 ),
0049
0050 TP_fast_assign(
0051 memcpy(__entry->state, state, MAX_DA_NAME_LEN);
0052 memcpy(__entry->event, event, MAX_DA_NAME_LEN);
0053 ),
0054
0055 TP_printk("event %s not expected in the state %s",
0056 __entry->event,
0057 __entry->state)
0058 );
0059
0060 #ifdef CONFIG_RV_MON_WIP
0061 DEFINE_EVENT(event_da_monitor, event_wip,
0062 TP_PROTO(char *state, char *event, char *next_state, bool final_state),
0063 TP_ARGS(state, event, next_state, final_state));
0064
0065 DEFINE_EVENT(error_da_monitor, error_wip,
0066 TP_PROTO(char *state, char *event),
0067 TP_ARGS(state, event));
0068 #endif
0069 #endif
0070
0071 #ifdef CONFIG_DA_MON_EVENTS_ID
0072 DECLARE_EVENT_CLASS(event_da_monitor_id,
0073
0074 TP_PROTO(int id, char *state, char *event, char *next_state, bool final_state),
0075
0076 TP_ARGS(id, state, event, next_state, final_state),
0077
0078 TP_STRUCT__entry(
0079 __field( int, id )
0080 __array( char, state, MAX_DA_NAME_LEN )
0081 __array( char, event, MAX_DA_NAME_LEN )
0082 __array( char, next_state, MAX_DA_NAME_LEN )
0083 __field( bool, final_state )
0084 ),
0085
0086 TP_fast_assign(
0087 memcpy(__entry->state, state, MAX_DA_NAME_LEN);
0088 memcpy(__entry->event, event, MAX_DA_NAME_LEN);
0089 memcpy(__entry->next_state, next_state, MAX_DA_NAME_LEN);
0090 __entry->id = id;
0091 __entry->final_state = final_state;
0092 ),
0093
0094 TP_printk("%d: %s x %s -> %s %s",
0095 __entry->id,
0096 __entry->state,
0097 __entry->event,
0098 __entry->next_state,
0099 __entry->final_state ? "(final)" : "")
0100 );
0101
0102 DECLARE_EVENT_CLASS(error_da_monitor_id,
0103
0104 TP_PROTO(int id, char *state, char *event),
0105
0106 TP_ARGS(id, state, event),
0107
0108 TP_STRUCT__entry(
0109 __field( int, id )
0110 __array( char, state, MAX_DA_NAME_LEN )
0111 __array( char, event, MAX_DA_NAME_LEN )
0112 ),
0113
0114 TP_fast_assign(
0115 memcpy(__entry->state, state, MAX_DA_NAME_LEN);
0116 memcpy(__entry->event, event, MAX_DA_NAME_LEN);
0117 __entry->id = id;
0118 ),
0119
0120 TP_printk("%d: event %s not expected in the state %s",
0121 __entry->id,
0122 __entry->event,
0123 __entry->state)
0124 );
0125
0126 #ifdef CONFIG_RV_MON_WWNR
0127
0128 DEFINE_EVENT(event_da_monitor_id, event_wwnr,
0129 TP_PROTO(int id, char *state, char *event, char *next_state, bool final_state),
0130 TP_ARGS(id, state, event, next_state, final_state));
0131
0132 DEFINE_EVENT(error_da_monitor_id, error_wwnr,
0133 TP_PROTO(int id, char *state, char *event),
0134 TP_ARGS(id, state, event));
0135 #endif
0136
0137 #endif
0138 #endif
0139
0140
0141 #undef TRACE_INCLUDE_PATH
0142 #include <trace/define_trace.h>