1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2013 - 2018 Intel Corporation. */
4 /* Modeled on trace-events-sample.h */
6 /* The trace subsystem name for i40e will be "i40e".
8 * This file is named i40e_trace.h.
10 * Since this include file's name is different from the trace
11 * subsystem name, we'll have to define TRACE_INCLUDE_FILE at the end
15 #define TRACE_SYSTEM i40e
17 /* See trace-events-sample.h for a detailed description of why this
18 * guard clause is different from most normal include files.
20 #if !defined(_I40E_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
21 #define _I40E_TRACE_H_
23 #include <linux/tracepoint.h>
26 * i40e_trace() macro enables shared code to refer to trace points
29 * trace_i40e{,vf}_example(args...)
33 * i40e_trace(example, args...)
35 * ... to resolve to the PF or VF version of the tracepoint without
36 * ifdefs, and to allow tracepoints to be disabled entirely at build
39 * Trace point should always be referred to in the driver via this
42 * Similarly, i40e_trace_enabled(trace_name) wraps references to
43 * trace_i40e{,vf}_<trace_name>_enabled() functions.
45 #define _I40E_TRACE_NAME(trace_name) (trace_ ## i40e ## _ ## trace_name)
46 #define I40E_TRACE_NAME(trace_name) _I40E_TRACE_NAME(trace_name)
48 #define i40e_trace(trace_name, args...) I40E_TRACE_NAME(trace_name)(args)
50 #define i40e_trace_enabled(trace_name) I40E_TRACE_NAME(trace_name##_enabled)()
52 /* Events common to PF and VF. Corresponding versions will be defined
53 * for both, named trace_i40e_* and trace_i40evf_*. The i40e_trace()
54 * macro above will select the right trace point name for the driver
55 * being built from shared code.
58 /* Events related to a vsi & ring */
62 TP_PROTO(struct i40e_ring *ring,
63 struct i40e_tx_desc *desc,
64 struct i40e_tx_buffer *buf),
66 TP_ARGS(ring, desc, buf),
68 /* The convention here is to make the first fields in the
69 * TP_STRUCT match the TP_PROTO exactly. This enables the use
70 * of the args struct generated by the tplist tool (from the
71 * bcc-tools package) to be used for those fields. To access
72 * fields other than the tracepoint args will require the
73 * tplist output to be adjusted.
79 __string(devname, ring->netdev->name)
86 __assign_str(devname, ring->netdev->name);
90 "netdev: %s ring: %p desc: %p buf %p",
91 __get_str(devname), __entry->ring,
92 __entry->desc, __entry->buf)
96 i40e_tx_template, i40e_clean_tx_irq,
97 TP_PROTO(struct i40e_ring *ring,
98 struct i40e_tx_desc *desc,
99 struct i40e_tx_buffer *buf),
101 TP_ARGS(ring, desc, buf));
104 i40e_tx_template, i40e_clean_tx_irq_unmap,
105 TP_PROTO(struct i40e_ring *ring,
106 struct i40e_tx_desc *desc,
107 struct i40e_tx_buffer *buf),
109 TP_ARGS(ring, desc, buf));
114 TP_PROTO(struct i40e_ring *ring,
115 union i40e_16byte_rx_desc *desc,
116 struct sk_buff *skb),
118 TP_ARGS(ring, desc, skb),
124 __string(devname, ring->netdev->name)
128 __entry->ring = ring;
129 __entry->desc = desc;
131 __assign_str(devname, ring->netdev->name);
135 "netdev: %s ring: %p desc: %p skb %p",
136 __get_str(devname), __entry->ring,
137 __entry->desc, __entry->skb)
141 i40e_rx_template, i40e_clean_rx_irq,
142 TP_PROTO(struct i40e_ring *ring,
143 union i40e_16byte_rx_desc *desc,
144 struct sk_buff *skb),
146 TP_ARGS(ring, desc, skb));
149 i40e_rx_template, i40e_clean_rx_irq_rx,
150 TP_PROTO(struct i40e_ring *ring,
151 union i40e_16byte_rx_desc *desc,
152 struct sk_buff *skb),
154 TP_ARGS(ring, desc, skb));
159 TP_PROTO(struct sk_buff *skb,
160 struct i40e_ring *ring),
167 __string(devname, ring->netdev->name)
172 __entry->ring = ring;
173 __assign_str(devname, ring->netdev->name);
177 "netdev: %s skb: %p ring: %p",
178 __get_str(devname), __entry->skb,
183 i40e_xmit_template, i40e_xmit_frame_ring,
184 TP_PROTO(struct sk_buff *skb,
185 struct i40e_ring *ring),
190 i40e_xmit_template, i40e_xmit_frame_ring_drop,
191 TP_PROTO(struct sk_buff *skb,
192 struct i40e_ring *ring),
196 /* Events unique to the PF. */
198 #endif /* _I40E_TRACE_H_ */
199 /* This must be outside ifdef _I40E_TRACE_H */
201 /* This trace include file is not located in the .../include/trace
202 * with the kernel tracepoint definitions, because we're a loadable
205 #undef TRACE_INCLUDE_PATH
206 #define TRACE_INCLUDE_PATH .
207 #undef TRACE_INCLUDE_FILE
208 #define TRACE_INCLUDE_FILE i40e_trace
209 #include <trace/define_trace.h>