~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/trace/events/devlink.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #if IS_ENABLED(CONFIG_NET_DEVLINK)
  3 
  4 #undef TRACE_SYSTEM
  5 #define TRACE_SYSTEM devlink
  6 
  7 #if !defined(_TRACE_DEVLINK_H) || defined(TRACE_HEADER_MULTI_READ)
  8 #define _TRACE_DEVLINK_H
  9 
 10 #include <linux/device.h>
 11 #include <net/devlink.h>
 12 #include <linux/tracepoint.h>
 13 
 14 /*
 15  * Tracepoint for devlink hardware message:
 16  */
 17 TRACE_EVENT(devlink_hwmsg,
 18         TP_PROTO(const struct devlink *devlink, bool incoming,
 19                  unsigned long type, const u8 *buf, size_t len),
 20 
 21         TP_ARGS(devlink, incoming, type, buf, len),
 22 
 23         TP_STRUCT__entry(
 24                 __string(bus_name, devlink_to_dev(devlink)->bus->name)
 25                 __string(dev_name, dev_name(devlink_to_dev(devlink)))
 26                 __string(driver_name, devlink_to_dev(devlink)->driver->name)
 27                 __field(bool, incoming)
 28                 __field(unsigned long, type)
 29                 __dynamic_array(u8, buf, len)
 30                 __field(size_t, len)
 31         ),
 32 
 33         TP_fast_assign(
 34                 __assign_str(bus_name);
 35                 __assign_str(dev_name);
 36                 __assign_str(driver_name);
 37                 __entry->incoming = incoming;
 38                 __entry->type = type;
 39                 memcpy(__get_dynamic_array(buf), buf, len);
 40                 __entry->len = len;
 41         ),
 42 
 43         TP_printk("bus_name=%s dev_name=%s driver_name=%s incoming=%d type=%lu buf=0x[%*phD] len=%zu",
 44                   __get_str(bus_name), __get_str(dev_name),
 45                   __get_str(driver_name), __entry->incoming, __entry->type,
 46                   (int) __entry->len, __get_dynamic_array(buf), __entry->len)
 47 );
 48 
 49 /*
 50  * Tracepoint for devlink hardware error:
 51  */
 52 TRACE_EVENT(devlink_hwerr,
 53         TP_PROTO(const struct devlink *devlink, int err, const char *msg),
 54 
 55         TP_ARGS(devlink, err, msg),
 56 
 57         TP_STRUCT__entry(
 58                 __string(bus_name, devlink_to_dev(devlink)->bus->name)
 59                 __string(dev_name, dev_name(devlink_to_dev(devlink)))
 60                 __string(driver_name, devlink_to_dev(devlink)->driver->name)
 61                 __field(int, err)
 62                 __string(msg, msg)
 63                 ),
 64 
 65         TP_fast_assign(
 66                 __assign_str(bus_name);
 67                 __assign_str(dev_name);
 68                 __assign_str(driver_name);
 69                 __entry->err = err;
 70                 __assign_str(msg);
 71                 ),
 72 
 73         TP_printk("bus_name=%s dev_name=%s driver_name=%s err=%d %s",
 74                         __get_str(bus_name), __get_str(dev_name),
 75                         __get_str(driver_name), __entry->err, __get_str(msg))
 76 );
 77 
 78 /*
 79  * Tracepoint for devlink health message:
 80  */
 81 TRACE_EVENT(devlink_health_report,
 82         TP_PROTO(const struct devlink *devlink, const char *reporter_name,
 83                  const char *msg),
 84 
 85         TP_ARGS(devlink, reporter_name, msg),
 86 
 87         TP_STRUCT__entry(
 88                 __string(bus_name, devlink_to_dev(devlink)->bus->name)
 89                 __string(dev_name, dev_name(devlink_to_dev(devlink)))
 90                 __string(driver_name, devlink_to_dev(devlink)->driver->name)
 91                 __string(reporter_name, reporter_name)
 92                 __string(msg, msg)
 93         ),
 94 
 95         TP_fast_assign(
 96                 __assign_str(bus_name);
 97                 __assign_str(dev_name);
 98                 __assign_str(driver_name);
 99                 __assign_str(reporter_name);
100                 __assign_str(msg);
101         ),
102 
103         TP_printk("bus_name=%s dev_name=%s driver_name=%s reporter_name=%s: %s",
104                   __get_str(bus_name), __get_str(dev_name),
105                   __get_str(driver_name), __get_str(reporter_name),
106                   __get_str(msg))
107 );
108 
109 /*
110  * Tracepoint for devlink health recover aborted message:
111  */
112 TRACE_EVENT(devlink_health_recover_aborted,
113         TP_PROTO(const struct devlink *devlink, const char *reporter_name,
114                  bool health_state, u64 time_since_last_recover),
115 
116         TP_ARGS(devlink, reporter_name, health_state, time_since_last_recover),
117 
118         TP_STRUCT__entry(
119                 __string(bus_name, devlink_to_dev(devlink)->bus->name)
120                 __string(dev_name, dev_name(devlink_to_dev(devlink)))
121                 __string(driver_name, devlink_to_dev(devlink)->driver->name)
122                 __string(reporter_name, reporter_name)
123                 __field(bool, health_state)
124                 __field(u64, time_since_last_recover)
125         ),
126 
127         TP_fast_assign(
128                 __assign_str(bus_name);
129                 __assign_str(dev_name);
130                 __assign_str(driver_name);
131                 __assign_str(reporter_name);
132                 __entry->health_state = health_state;
133                 __entry->time_since_last_recover = time_since_last_recover;
134         ),
135 
136         TP_printk("bus_name=%s dev_name=%s driver_name=%s reporter_name=%s: health_state=%d time_since_last_recover=%llu recover aborted",
137                   __get_str(bus_name), __get_str(dev_name),
138                   __get_str(driver_name), __get_str(reporter_name),
139                   __entry->health_state,
140                   __entry->time_since_last_recover)
141 );
142 
143 /*
144  * Tracepoint for devlink health reporter state update:
145  */
146 TRACE_EVENT(devlink_health_reporter_state_update,
147         TP_PROTO(const struct devlink *devlink, const char *reporter_name,
148                  bool new_state),
149 
150         TP_ARGS(devlink, reporter_name, new_state),
151 
152         TP_STRUCT__entry(
153                 __string(bus_name, devlink_to_dev(devlink)->bus->name)
154                 __string(dev_name, dev_name(devlink_to_dev(devlink)))
155                 __string(driver_name, devlink_to_dev(devlink)->driver->name)
156                 __string(reporter_name, reporter_name)
157                 __field(u8, new_state)
158         ),
159 
160         TP_fast_assign(
161                 __assign_str(bus_name);
162                 __assign_str(dev_name);
163                 __assign_str(driver_name);
164                 __assign_str(reporter_name);
165                 __entry->new_state = new_state;
166         ),
167 
168         TP_printk("bus_name=%s dev_name=%s driver_name=%s reporter_name=%s: new_state=%d",
169                   __get_str(bus_name), __get_str(dev_name),
170                   __get_str(driver_name), __get_str(reporter_name),
171                   __entry->new_state)
172 );
173 
174 /*
175  * Tracepoint for devlink packet trap:
176  */
177 TRACE_EVENT(devlink_trap_report,
178         TP_PROTO(const struct devlink *devlink, struct sk_buff *skb,
179                  const struct devlink_trap_metadata *metadata),
180 
181         TP_ARGS(devlink, skb, metadata),
182 
183         TP_STRUCT__entry(
184                 __string(bus_name, devlink_to_dev(devlink)->bus->name)
185                 __string(dev_name, dev_name(devlink_to_dev(devlink)))
186                 __string(driver_name, devlink_to_dev(devlink)->driver->name)
187                 __string(trap_name, metadata->trap_name)
188                 __string(trap_group_name, metadata->trap_group_name)
189                 __array(char, input_dev_name, IFNAMSIZ)
190         ),
191 
192         TP_fast_assign(
193                 struct net_device *input_dev = metadata->input_dev;
194 
195                 __assign_str(bus_name);
196                 __assign_str(dev_name);
197                 __assign_str(driver_name);
198                 __assign_str(trap_name);
199                 __assign_str(trap_group_name);
200                 strscpy(__entry->input_dev_name, input_dev ? input_dev->name : "NULL", IFNAMSIZ);
201         ),
202 
203         TP_printk("bus_name=%s dev_name=%s driver_name=%s trap_name=%s "
204                   "trap_group_name=%s input_dev_name=%s", __get_str(bus_name),
205                   __get_str(dev_name), __get_str(driver_name),
206                   __get_str(trap_name), __get_str(trap_group_name),
207                   __entry->input_dev_name)
208 );
209 
210 #endif /* _TRACE_DEVLINK_H */
211 
212 /* This part must be outside protection */
213 #include <trace/define_trace.h>
214 
215 #else /* CONFIG_NET_DEVLINK */
216 
217 #if !defined(_TRACE_DEVLINK_H)
218 #define _TRACE_DEVLINK_H
219 
220 #include <net/devlink.h>
221 
222 static inline void trace_devlink_hwmsg(const struct devlink *devlink,
223                                        bool incoming, unsigned long type,
224                                        const u8 *buf, size_t len)
225 {
226 }
227 
228 static inline void trace_devlink_hwerr(const struct devlink *devlink,
229                                        int err, const char *msg)
230 {
231 }
232 #endif /* _TRACE_DEVLINK_H */
233 
234 #endif
235 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php