xref: /linux/drivers/net/ethernet/fungible/funeth/funeth_trace.h (revision 40d269c000bda9fcd276a0412a9cebd3f6e344c5)
1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2 
3 #undef TRACE_SYSTEM
4 #define TRACE_SYSTEM funeth
5 
6 #if !defined(_TRACE_FUNETH_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define _TRACE_FUNETH_H
8 
9 #include <linux/tracepoint.h>
10 
11 #include "funeth_txrx.h"
12 
13 TRACE_EVENT(funeth_tx,
14 
15 	TP_PROTO(const struct funeth_txq *txq,
16 		 u32 len,
17 		 u32 sqe_idx,
18 		 u32 ngle),
19 
20 	TP_ARGS(txq, len, sqe_idx, ngle),
21 
22 	TP_STRUCT__entry(
23 		__field(u32, qidx)
24 		__field(u32, len)
25 		__field(u32, sqe_idx)
26 		__field(u32, ngle)
27 		__string(devname, txq->netdev->name)
28 	),
29 
30 	TP_fast_assign(
31 		__entry->qidx = txq->qidx;
32 		__entry->len = len;
33 		__entry->sqe_idx = sqe_idx;
34 		__entry->ngle = ngle;
35 		__assign_str(devname, txq->netdev->name);
36 	),
37 
38 	TP_printk("%s: Txq %u, SQE idx %u, len %u, num GLEs %u",
39 		  __get_str(devname), __entry->qidx, __entry->sqe_idx,
40 		  __entry->len, __entry->ngle)
41 );
42 
43 TRACE_EVENT(funeth_tx_free,
44 
45 	TP_PROTO(const struct funeth_txq *txq,
46 		 u32 sqe_idx,
47 		 u32 num_sqes,
48 		 u32 hw_head),
49 
50 	TP_ARGS(txq, sqe_idx, num_sqes, hw_head),
51 
52 	TP_STRUCT__entry(
53 		__field(u32, qidx)
54 		__field(u32, sqe_idx)
55 		__field(u32, num_sqes)
56 		__field(u32, hw_head)
57 		__string(devname, txq->netdev->name)
58 	),
59 
60 	TP_fast_assign(
61 		__entry->qidx = txq->qidx;
62 		__entry->sqe_idx = sqe_idx;
63 		__entry->num_sqes = num_sqes;
64 		__entry->hw_head = hw_head;
65 		__assign_str(devname, txq->netdev->name);
66 	),
67 
68 	TP_printk("%s: Txq %u, SQE idx %u, SQEs %u, HW head %u",
69 		  __get_str(devname), __entry->qidx, __entry->sqe_idx,
70 		  __entry->num_sqes, __entry->hw_head)
71 );
72 
73 TRACE_EVENT(funeth_rx,
74 
75 	TP_PROTO(const struct funeth_rxq *rxq,
76 		 u32 num_rqes,
77 		 u32 pkt_len,
78 		 u32 hash,
79 		 u32 cls_vec),
80 
81 	TP_ARGS(rxq, num_rqes, pkt_len, hash, cls_vec),
82 
83 	TP_STRUCT__entry(
84 		__field(u32, qidx)
85 		__field(u32, cq_head)
86 		__field(u32, num_rqes)
87 		__field(u32, len)
88 		__field(u32, hash)
89 		__field(u32, cls_vec)
90 		__string(devname, rxq->netdev->name)
91 	),
92 
93 	TP_fast_assign(
94 		__entry->qidx = rxq->qidx;
95 		__entry->cq_head = rxq->cq_head;
96 		__entry->num_rqes = num_rqes;
97 		__entry->len = pkt_len;
98 		__entry->hash = hash;
99 		__entry->cls_vec = cls_vec;
100 		__assign_str(devname, rxq->netdev->name);
101 	),
102 
103 	TP_printk("%s: Rxq %u, CQ head %u, RQEs %u, len %u, hash %u, CV %#x",
104 		  __get_str(devname), __entry->qidx, __entry->cq_head,
105 		  __entry->num_rqes, __entry->len, __entry->hash,
106 		  __entry->cls_vec)
107 );
108 
109 #endif /* _TRACE_FUNETH_H */
110 
111 /* Below must be outside protection. */
112 #undef TRACE_INCLUDE_PATH
113 #define TRACE_INCLUDE_PATH .
114 #undef TRACE_INCLUDE_FILE
115 #define TRACE_INCLUDE_FILE funeth_trace
116 
117 #include <trace/define_trace.h>
118