1 /*******************************************************************************
3 * Intel(R) 40-10 Gigabit Ethernet Connection Network Driver
4 * Copyright(c) 2013 - 2017 Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * The full GNU General Public License is included in this distribution in
16 * the file called "COPYING".
18 * Contact Information:
19 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
20 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
22 ******************************************************************************/
24 /* Modeled on trace-events-sample.h */
26 /* The trace subsystem name for i40e will be "i40e".
28 * This file is named i40e_trace.h.
30 * Since this include file's name is different from the trace
31 * subsystem name, we'll have to define TRACE_INCLUDE_FILE at the end
35 #define TRACE_SYSTEM i40e
37 /* See trace-events-sample.h for a detailed description of why this
38 * guard clause is different from most normal include files.
40 #if !defined(_I40E_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
41 #define _I40E_TRACE_H_
43 #include <linux/tracepoint.h>
46 * i40e_trace() macro enables shared code to refer to trace points
49 * trace_i40e{,vf}_example(args...)
53 * i40e_trace(example, args...)
55 * ... to resolve to the PF or VF version of the tracepoint without
56 * ifdefs, and to allow tracepoints to be disabled entirely at build
59 * Trace point should always be referred to in the driver via this
62 * Similarly, i40e_trace_enabled(trace_name) wraps references to
63 * trace_i40e{,vf}_<trace_name>_enabled() functions.
65 #define _I40E_TRACE_NAME(trace_name) (trace_ ## i40e ## _ ## trace_name)
66 #define I40E_TRACE_NAME(trace_name) _I40E_TRACE_NAME(trace_name)
68 #define i40e_trace(trace_name, args...) I40E_TRACE_NAME(trace_name)(args)
70 #define i40e_trace_enabled(trace_name) I40E_TRACE_NAME(trace_name##_enabled)()
72 /* Events common to PF and VF. Corresponding versions will be defined
73 * for both, named trace_i40e_* and trace_i40evf_*. The i40e_trace()
74 * macro above will select the right trace point name for the driver
75 * being built from shared code.
78 /* Events related to a vsi & ring */
82 TP_PROTO(struct i40e_ring
*ring
,
83 struct i40e_tx_desc
*desc
,
84 struct i40e_tx_buffer
*buf
),
86 TP_ARGS(ring
, desc
, buf
),
88 /* The convention here is to make the first fields in the
89 * TP_STRUCT match the TP_PROTO exactly. This enables the use
90 * of the args struct generated by the tplist tool (from the
91 * bcc-tools package) to be used for those fields. To access
92 * fields other than the tracepoint args will require the
93 * tplist output to be adjusted.
99 __string(devname
, ring
->netdev
->name
)
103 __entry
->ring
= ring
;
104 __entry
->desc
= desc
;
106 __assign_str(devname
, ring
->netdev
->name
);
110 "netdev: %s ring: %p desc: %p buf %p",
111 __get_str(devname
), __entry
->ring
,
112 __entry
->desc
, __entry
->buf
)
116 i40e_tx_template
, i40e_clean_tx_irq
,
117 TP_PROTO(struct i40e_ring
*ring
,
118 struct i40e_tx_desc
*desc
,
119 struct i40e_tx_buffer
*buf
),
121 TP_ARGS(ring
, desc
, buf
));
124 i40e_tx_template
, i40e_clean_tx_irq_unmap
,
125 TP_PROTO(struct i40e_ring
*ring
,
126 struct i40e_tx_desc
*desc
,
127 struct i40e_tx_buffer
*buf
),
129 TP_ARGS(ring
, desc
, buf
));
134 TP_PROTO(struct i40e_ring
*ring
,
135 union i40e_32byte_rx_desc
*desc
,
136 struct sk_buff
*skb
),
138 TP_ARGS(ring
, desc
, skb
),
144 __string(devname
, ring
->netdev
->name
)
148 __entry
->ring
= ring
;
149 __entry
->desc
= desc
;
151 __assign_str(devname
, ring
->netdev
->name
);
155 "netdev: %s ring: %p desc: %p skb %p",
156 __get_str(devname
), __entry
->ring
,
157 __entry
->desc
, __entry
->skb
)
161 i40e_rx_template
, i40e_clean_rx_irq
,
162 TP_PROTO(struct i40e_ring
*ring
,
163 union i40e_32byte_rx_desc
*desc
,
164 struct sk_buff
*skb
),
166 TP_ARGS(ring
, desc
, skb
));
169 i40e_rx_template
, i40e_clean_rx_irq_rx
,
170 TP_PROTO(struct i40e_ring
*ring
,
171 union i40e_32byte_rx_desc
*desc
,
172 struct sk_buff
*skb
),
174 TP_ARGS(ring
, desc
, skb
));
179 TP_PROTO(struct sk_buff
*skb
,
180 struct i40e_ring
*ring
),
187 __string(devname
, ring
->netdev
->name
)
192 __entry
->ring
= ring
;
193 __assign_str(devname
, ring
->netdev
->name
);
197 "netdev: %s skb: %p ring: %p",
198 __get_str(devname
), __entry
->skb
,
203 i40e_xmit_template
, i40e_xmit_frame_ring
,
204 TP_PROTO(struct sk_buff
*skb
,
205 struct i40e_ring
*ring
),
210 i40e_xmit_template
, i40e_xmit_frame_ring_drop
,
211 TP_PROTO(struct sk_buff
*skb
,
212 struct i40e_ring
*ring
),
216 /* Events unique to the PF. */
218 #endif /* _I40E_TRACE_H_ */
219 /* This must be outside ifdef _I40E_TRACE_H */
221 /* This trace include file is not located in the .../include/trace
222 * with the kernel tracepoint definitions, because we're a loadable
225 #undef TRACE_INCLUDE_PATH
226 #define TRACE_INCLUDE_PATH .
227 #undef TRACE_INCLUDE_FILE
228 #define TRACE_INCLUDE_FILE i40e_trace
229 #include <trace/define_trace.h>