xref: /openbmc/linux/include/trace/events/mctp.h (revision 0a907292)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #undef TRACE_SYSTEM
4 #define TRACE_SYSTEM mctp
5 
6 #if !defined(_TRACE_MCTP_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define _TRACE_MCTP_H
8 
9 #include <linux/tracepoint.h>
10 
11 #ifndef __TRACE_MCTP_ENUMS
12 #define __TRACE_MCTP_ENUMS
13 enum {
14 	MCTP_TRACE_KEY_TIMEOUT,
15 	MCTP_TRACE_KEY_REPLIED,
16 	MCTP_TRACE_KEY_INVALIDATED,
17 	MCTP_TRACE_KEY_CLOSED,
18 };
19 #endif /* __TRACE_MCTP_ENUMS */
20 
21 TRACE_DEFINE_ENUM(MCTP_TRACE_KEY_TIMEOUT);
22 TRACE_DEFINE_ENUM(MCTP_TRACE_KEY_REPLIED);
23 TRACE_DEFINE_ENUM(MCTP_TRACE_KEY_INVALIDATED);
24 TRACE_DEFINE_ENUM(MCTP_TRACE_KEY_CLOSED);
25 
26 TRACE_EVENT(mctp_key_acquire,
27 	TP_PROTO(const struct mctp_sk_key *key),
28 	TP_ARGS(key),
29 	TP_STRUCT__entry(
30 		__field(__u8,	paddr)
31 		__field(__u8,	laddr)
32 		__field(__u8,	tag)
33 	),
34 	TP_fast_assign(
35 		__entry->paddr = key->peer_addr;
36 		__entry->laddr = key->local_addr;
37 		__entry->tag = key->tag;
38 	),
39 	TP_printk("local %d, peer %d, tag %1x",
40 		__entry->laddr,
41 		__entry->paddr,
42 		__entry->tag
43 	)
44 );
45 
46 TRACE_EVENT(mctp_key_release,
47 	TP_PROTO(const struct mctp_sk_key *key, int reason),
48 	TP_ARGS(key, reason),
49 	TP_STRUCT__entry(
50 		__field(__u8,	paddr)
51 		__field(__u8,	laddr)
52 		__field(__u8,	tag)
53 		__field(int,	reason)
54 	),
55 	TP_fast_assign(
56 		__entry->paddr = key->peer_addr;
57 		__entry->laddr = key->local_addr;
58 		__entry->tag = key->tag;
59 		__entry->reason = reason;
60 	),
61 	TP_printk("local %d, peer %d, tag %1x %s",
62 		__entry->laddr,
63 		__entry->paddr,
64 		__entry->tag,
65 		__print_symbolic(__entry->reason,
66 				 { MCTP_TRACE_KEY_TIMEOUT, "timeout" },
67 				 { MCTP_TRACE_KEY_REPLIED, "replied" },
68 				 { MCTP_TRACE_KEY_INVALIDATED, "invalidated" },
69 				 { MCTP_TRACE_KEY_CLOSED, "closed" })
70 	)
71 );
72 
73 #endif
74 
75 #include <trace/define_trace.h>
76