staging: rtl8188eu: Replace function name in string with __func__
[linux/fpc-iii.git] / drivers / net / ethernet / intel / i40e / i40e_trace.h
blobd3e55f54a05e2007399f457e01c7424b5196c9ed
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
13 * more details.
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
32 * of this file.
34 #undef TRACE_SYSTEM
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>
45 /**
46 * i40e_trace() macro enables shared code to refer to trace points
47 * like:
49 * trace_i40e{,vf}_example(args...)
51 * ... as:
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
57 * time.
59 * Trace point should always be referred to in the driver via this
60 * macro.
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 */
79 DECLARE_EVENT_CLASS(
80 i40e_tx_template,
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.
95 TP_STRUCT__entry(
96 __field(void*, ring)
97 __field(void*, desc)
98 __field(void*, buf)
99 __string(devname, ring->netdev->name)
102 TP_fast_assign(
103 __entry->ring = ring;
104 __entry->desc = desc;
105 __entry->buf = buf;
106 __assign_str(devname, ring->netdev->name);
109 TP_printk(
110 "netdev: %s ring: %p desc: %p buf %p",
111 __get_str(devname), __entry->ring,
112 __entry->desc, __entry->buf)
115 DEFINE_EVENT(
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));
123 DEFINE_EVENT(
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));
131 DECLARE_EVENT_CLASS(
132 i40e_rx_template,
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),
140 TP_STRUCT__entry(
141 __field(void*, ring)
142 __field(void*, desc)
143 __field(void*, skb)
144 __string(devname, ring->netdev->name)
147 TP_fast_assign(
148 __entry->ring = ring;
149 __entry->desc = desc;
150 __entry->skb = skb;
151 __assign_str(devname, ring->netdev->name);
154 TP_printk(
155 "netdev: %s ring: %p desc: %p skb %p",
156 __get_str(devname), __entry->ring,
157 __entry->desc, __entry->skb)
160 DEFINE_EVENT(
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));
168 DEFINE_EVENT(
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));
176 DECLARE_EVENT_CLASS(
177 i40e_xmit_template,
179 TP_PROTO(struct sk_buff *skb,
180 struct i40e_ring *ring),
182 TP_ARGS(skb, ring),
184 TP_STRUCT__entry(
185 __field(void*, skb)
186 __field(void*, ring)
187 __string(devname, ring->netdev->name)
190 TP_fast_assign(
191 __entry->skb = skb;
192 __entry->ring = ring;
193 __assign_str(devname, ring->netdev->name);
196 TP_printk(
197 "netdev: %s skb: %p ring: %p",
198 __get_str(devname), __entry->skb,
199 __entry->ring)
202 DEFINE_EVENT(
203 i40e_xmit_template, i40e_xmit_frame_ring,
204 TP_PROTO(struct sk_buff *skb,
205 struct i40e_ring *ring),
207 TP_ARGS(skb, ring));
209 DEFINE_EVENT(
210 i40e_xmit_template, i40e_xmit_frame_ring_drop,
211 TP_PROTO(struct sk_buff *skb,
212 struct i40e_ring *ring),
214 TP_ARGS(skb, 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
223 * module.
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>