xref: /linux/include/trace/events/rv.h (revision 0526b56cbc3c489642bd6a5fe4b718dea7ef0ee8)
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 
60 #ifdef CONFIG_RV_MON_WIP
61 DEFINE_EVENT(event_da_monitor, event_wip,
62 	    TP_PROTO(char *state, char *event, char *next_state, bool final_state),
63 	    TP_ARGS(state, event, next_state, final_state));
64 
65 DEFINE_EVENT(error_da_monitor, error_wip,
66 	     TP_PROTO(char *state, char *event),
67 	     TP_ARGS(state, event));
68 #endif /* CONFIG_RV_MON_WIP */
69 #endif /* CONFIG_DA_MON_EVENTS_IMPLICIT */
70 
71 #ifdef CONFIG_DA_MON_EVENTS_ID
72 DECLARE_EVENT_CLASS(event_da_monitor_id,
73 
74 	TP_PROTO(int id, char *state, char *event, char *next_state, bool final_state),
75 
76 	TP_ARGS(id, state, event, next_state, final_state),
77 
78 	TP_STRUCT__entry(
79 		__field(	int,	id				)
80 		__array(	char,	state,		MAX_DA_NAME_LEN	)
81 		__array(	char,	event,		MAX_DA_NAME_LEN	)
82 		__array(	char,	next_state,	MAX_DA_NAME_LEN	)
83 		__field(	bool,	final_state			)
84 	),
85 
86 	TP_fast_assign(
87 		memcpy(__entry->state,		state,		MAX_DA_NAME_LEN);
88 		memcpy(__entry->event,		event,		MAX_DA_NAME_LEN);
89 		memcpy(__entry->next_state,	next_state,	MAX_DA_NAME_LEN);
90 		__entry->id			= id;
91 		__entry->final_state		= final_state;
92 	),
93 
94 	TP_printk("%d: %s x %s -> %s %s",
95 		__entry->id,
96 		__entry->state,
97 		__entry->event,
98 		__entry->next_state,
99 		__entry->final_state ? "(final)" : "")
100 );
101 
102 DECLARE_EVENT_CLASS(error_da_monitor_id,
103 
104 	TP_PROTO(int id, char *state, char *event),
105 
106 	TP_ARGS(id, state, event),
107 
108 	TP_STRUCT__entry(
109 		__field(	int,	id				)
110 		__array(	char,	state,		MAX_DA_NAME_LEN	)
111 		__array(	char,	event,		MAX_DA_NAME_LEN	)
112 	),
113 
114 	TP_fast_assign(
115 		memcpy(__entry->state,		state,		MAX_DA_NAME_LEN);
116 		memcpy(__entry->event,		event,		MAX_DA_NAME_LEN);
117 		__entry->id			= id;
118 	),
119 
120 	TP_printk("%d: event %s not expected in the state %s",
121 		__entry->id,
122 		__entry->event,
123 		__entry->state)
124 );
125 
126 #ifdef CONFIG_RV_MON_WWNR
127 /* id is the pid of the task */
128 DEFINE_EVENT(event_da_monitor_id, event_wwnr,
129 	     TP_PROTO(int id, char *state, char *event, char *next_state, bool final_state),
130 	     TP_ARGS(id, state, event, next_state, final_state));
131 
132 DEFINE_EVENT(error_da_monitor_id, error_wwnr,
133 	     TP_PROTO(int id, char *state, char *event),
134 	     TP_ARGS(id, state, event));
135 #endif /* CONFIG_RV_MON_WWNR */
136 
137 #endif /* CONFIG_DA_MON_EVENTS_ID */
138 #endif /* _TRACE_RV_H */
139 
140 /* This part ust be outside protection */
141 #undef TRACE_INCLUDE_PATH
142 #include <trace/define_trace.h>
143