xref: /openbmc/linux/include/trace/events/rv.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
179257534SDaniel Bristot de Oliveira /* SPDX-License-Identifier: GPL-2.0 */
279257534SDaniel Bristot de Oliveira #undef TRACE_SYSTEM
379257534SDaniel Bristot de Oliveira #define TRACE_SYSTEM rv
479257534SDaniel Bristot de Oliveira 
579257534SDaniel Bristot de Oliveira #if !defined(_TRACE_RV_H) || defined(TRACE_HEADER_MULTI_READ)
679257534SDaniel Bristot de Oliveira #define _TRACE_RV_H
779257534SDaniel Bristot de Oliveira 
879257534SDaniel Bristot de Oliveira #include <linux/rv.h>
979257534SDaniel Bristot de Oliveira #include <linux/tracepoint.h>
1079257534SDaniel Bristot de Oliveira 
1179257534SDaniel Bristot de Oliveira #ifdef CONFIG_DA_MON_EVENTS_IMPLICIT
1279257534SDaniel Bristot de Oliveira DECLARE_EVENT_CLASS(event_da_monitor,
1379257534SDaniel Bristot de Oliveira 
1479257534SDaniel Bristot de Oliveira 	TP_PROTO(char *state, char *event, char *next_state, bool final_state),
1579257534SDaniel Bristot de Oliveira 
1679257534SDaniel Bristot de Oliveira 	TP_ARGS(state, event, next_state, final_state),
1779257534SDaniel Bristot de Oliveira 
1879257534SDaniel Bristot de Oliveira 	TP_STRUCT__entry(
1979257534SDaniel Bristot de Oliveira 		__array(	char,	state,		MAX_DA_NAME_LEN	)
2079257534SDaniel Bristot de Oliveira 		__array(	char,	event,		MAX_DA_NAME_LEN	)
2179257534SDaniel Bristot de Oliveira 		__array(	char,	next_state,	MAX_DA_NAME_LEN	)
2279257534SDaniel Bristot de Oliveira 		__field(	bool,	final_state			)
2379257534SDaniel Bristot de Oliveira 	),
2479257534SDaniel Bristot de Oliveira 
2579257534SDaniel Bristot de Oliveira 	TP_fast_assign(
2679257534SDaniel Bristot de Oliveira 		memcpy(__entry->state,		state,		MAX_DA_NAME_LEN);
2779257534SDaniel Bristot de Oliveira 		memcpy(__entry->event,		event,		MAX_DA_NAME_LEN);
2879257534SDaniel Bristot de Oliveira 		memcpy(__entry->next_state,	next_state,	MAX_DA_NAME_LEN);
2979257534SDaniel Bristot de Oliveira 		__entry->final_state		= final_state;
3079257534SDaniel Bristot de Oliveira 	),
3179257534SDaniel Bristot de Oliveira 
3279257534SDaniel Bristot de Oliveira 	TP_printk("%s x %s -> %s %s",
3379257534SDaniel Bristot de Oliveira 		__entry->state,
3479257534SDaniel Bristot de Oliveira 		__entry->event,
3579257534SDaniel Bristot de Oliveira 		__entry->next_state,
3679257534SDaniel Bristot de Oliveira 		__entry->final_state ? "(final)" : "")
3779257534SDaniel Bristot de Oliveira );
3879257534SDaniel Bristot de Oliveira 
3979257534SDaniel Bristot de Oliveira DECLARE_EVENT_CLASS(error_da_monitor,
4079257534SDaniel Bristot de Oliveira 
4179257534SDaniel Bristot de Oliveira 	TP_PROTO(char *state, char *event),
4279257534SDaniel Bristot de Oliveira 
4379257534SDaniel Bristot de Oliveira 	TP_ARGS(state, event),
4479257534SDaniel Bristot de Oliveira 
4579257534SDaniel Bristot de Oliveira 	TP_STRUCT__entry(
4679257534SDaniel Bristot de Oliveira 		__array(	char,	state,		MAX_DA_NAME_LEN	)
4779257534SDaniel Bristot de Oliveira 		__array(	char,	event,		MAX_DA_NAME_LEN	)
4879257534SDaniel Bristot de Oliveira 	),
4979257534SDaniel Bristot de Oliveira 
5079257534SDaniel Bristot de Oliveira 	TP_fast_assign(
5179257534SDaniel Bristot de Oliveira 		memcpy(__entry->state,		state,		MAX_DA_NAME_LEN);
5279257534SDaniel Bristot de Oliveira 		memcpy(__entry->event,		event,		MAX_DA_NAME_LEN);
5379257534SDaniel Bristot de Oliveira 	),
5479257534SDaniel Bristot de Oliveira 
5579257534SDaniel Bristot de Oliveira 	TP_printk("event %s not expected in the state %s",
5679257534SDaniel Bristot de Oliveira 		__entry->event,
5779257534SDaniel Bristot de Oliveira 		__entry->state)
5879257534SDaniel Bristot de Oliveira );
5910bde81cSDaniel Bristot de Oliveira 
6010bde81cSDaniel Bristot de Oliveira #ifdef CONFIG_RV_MON_WIP
6110bde81cSDaniel Bristot de Oliveira DEFINE_EVENT(event_da_monitor, event_wip,
6210bde81cSDaniel Bristot de Oliveira 	    TP_PROTO(char *state, char *event, char *next_state, bool final_state),
6310bde81cSDaniel Bristot de Oliveira 	    TP_ARGS(state, event, next_state, final_state));
6410bde81cSDaniel Bristot de Oliveira 
6510bde81cSDaniel Bristot de Oliveira DEFINE_EVENT(error_da_monitor, error_wip,
6610bde81cSDaniel Bristot de Oliveira 	     TP_PROTO(char *state, char *event),
6710bde81cSDaniel Bristot de Oliveira 	     TP_ARGS(state, event));
6810bde81cSDaniel Bristot de Oliveira #endif /* CONFIG_RV_MON_WIP */
6979257534SDaniel Bristot de Oliveira #endif /* CONFIG_DA_MON_EVENTS_IMPLICIT */
7079257534SDaniel Bristot de Oliveira 
7179257534SDaniel Bristot de Oliveira #ifdef CONFIG_DA_MON_EVENTS_ID
7279257534SDaniel Bristot de Oliveira DECLARE_EVENT_CLASS(event_da_monitor_id,
7379257534SDaniel Bristot de Oliveira 
7479257534SDaniel Bristot de Oliveira 	TP_PROTO(int id, char *state, char *event, char *next_state, bool final_state),
7579257534SDaniel Bristot de Oliveira 
7679257534SDaniel Bristot de Oliveira 	TP_ARGS(id, state, event, next_state, final_state),
7779257534SDaniel Bristot de Oliveira 
7879257534SDaniel Bristot de Oliveira 	TP_STRUCT__entry(
7979257534SDaniel Bristot de Oliveira 		__field(	int,	id				)
8079257534SDaniel Bristot de Oliveira 		__array(	char,	state,		MAX_DA_NAME_LEN	)
8179257534SDaniel Bristot de Oliveira 		__array(	char,	event,		MAX_DA_NAME_LEN	)
8279257534SDaniel Bristot de Oliveira 		__array(	char,	next_state,	MAX_DA_NAME_LEN	)
8379257534SDaniel Bristot de Oliveira 		__field(	bool,	final_state			)
8479257534SDaniel Bristot de Oliveira 	),
8579257534SDaniel Bristot de Oliveira 
8679257534SDaniel Bristot de Oliveira 	TP_fast_assign(
8779257534SDaniel Bristot de Oliveira 		memcpy(__entry->state,		state,		MAX_DA_NAME_LEN);
8879257534SDaniel Bristot de Oliveira 		memcpy(__entry->event,		event,		MAX_DA_NAME_LEN);
8979257534SDaniel Bristot de Oliveira 		memcpy(__entry->next_state,	next_state,	MAX_DA_NAME_LEN);
9079257534SDaniel Bristot de Oliveira 		__entry->id			= id;
9179257534SDaniel Bristot de Oliveira 		__entry->final_state		= final_state;
9279257534SDaniel Bristot de Oliveira 	),
9379257534SDaniel Bristot de Oliveira 
9479257534SDaniel Bristot de Oliveira 	TP_printk("%d: %s x %s -> %s %s",
9579257534SDaniel Bristot de Oliveira 		__entry->id,
9679257534SDaniel Bristot de Oliveira 		__entry->state,
9779257534SDaniel Bristot de Oliveira 		__entry->event,
9879257534SDaniel Bristot de Oliveira 		__entry->next_state,
9979257534SDaniel Bristot de Oliveira 		__entry->final_state ? "(final)" : "")
10079257534SDaniel Bristot de Oliveira );
10179257534SDaniel Bristot de Oliveira 
10279257534SDaniel Bristot de Oliveira DECLARE_EVENT_CLASS(error_da_monitor_id,
10379257534SDaniel Bristot de Oliveira 
10479257534SDaniel Bristot de Oliveira 	TP_PROTO(int id, char *state, char *event),
10579257534SDaniel Bristot de Oliveira 
10679257534SDaniel Bristot de Oliveira 	TP_ARGS(id, state, event),
10779257534SDaniel Bristot de Oliveira 
10879257534SDaniel Bristot de Oliveira 	TP_STRUCT__entry(
10979257534SDaniel Bristot de Oliveira 		__field(	int,	id				)
11079257534SDaniel Bristot de Oliveira 		__array(	char,	state,		MAX_DA_NAME_LEN	)
11179257534SDaniel Bristot de Oliveira 		__array(	char,	event,		MAX_DA_NAME_LEN	)
11279257534SDaniel Bristot de Oliveira 	),
11379257534SDaniel Bristot de Oliveira 
11479257534SDaniel Bristot de Oliveira 	TP_fast_assign(
11579257534SDaniel Bristot de Oliveira 		memcpy(__entry->state,		state,		MAX_DA_NAME_LEN);
11679257534SDaniel Bristot de Oliveira 		memcpy(__entry->event,		event,		MAX_DA_NAME_LEN);
11779257534SDaniel Bristot de Oliveira 		__entry->id			= id;
11879257534SDaniel Bristot de Oliveira 	),
11979257534SDaniel Bristot de Oliveira 
12079257534SDaniel Bristot de Oliveira 	TP_printk("%d: event %s not expected in the state %s",
12179257534SDaniel Bristot de Oliveira 		__entry->id,
12279257534SDaniel Bristot de Oliveira 		__entry->event,
12379257534SDaniel Bristot de Oliveira 		__entry->state)
12479257534SDaniel Bristot de Oliveira );
125*ccc319dcSDaniel Bristot de Oliveira 
126*ccc319dcSDaniel Bristot de Oliveira #ifdef CONFIG_RV_MON_WWNR
127*ccc319dcSDaniel Bristot de Oliveira /* id is the pid of the task */
128*ccc319dcSDaniel Bristot de Oliveira DEFINE_EVENT(event_da_monitor_id, event_wwnr,
129*ccc319dcSDaniel Bristot de Oliveira 	     TP_PROTO(int id, char *state, char *event, char *next_state, bool final_state),
130*ccc319dcSDaniel Bristot de Oliveira 	     TP_ARGS(id, state, event, next_state, final_state));
131*ccc319dcSDaniel Bristot de Oliveira 
132*ccc319dcSDaniel Bristot de Oliveira DEFINE_EVENT(error_da_monitor_id, error_wwnr,
133*ccc319dcSDaniel Bristot de Oliveira 	     TP_PROTO(int id, char *state, char *event),
134*ccc319dcSDaniel Bristot de Oliveira 	     TP_ARGS(id, state, event));
135*ccc319dcSDaniel Bristot de Oliveira #endif /* CONFIG_RV_MON_WWNR */
136*ccc319dcSDaniel Bristot de Oliveira 
13779257534SDaniel Bristot de Oliveira #endif /* CONFIG_DA_MON_EVENTS_ID */
13879257534SDaniel Bristot de Oliveira #endif /* _TRACE_RV_H */
13979257534SDaniel Bristot de Oliveira 
14079257534SDaniel Bristot de Oliveira /* This part ust be outside protection */
14179257534SDaniel Bristot de Oliveira #undef TRACE_INCLUDE_PATH
14279257534SDaniel Bristot de Oliveira #include <trace/define_trace.h>
143