1 /* SPDX-License-Identifier: GPL-2.0 */ << 2 #undef TRACE_SYSTEM 1 #undef TRACE_SYSTEM 3 #define TRACE_SYSTEM net 2 #define TRACE_SYSTEM net 4 3 5 #if !defined(_TRACE_NET_H) || defined(TRACE_HE 4 #if !defined(_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ) 6 #define _TRACE_NET_H 5 #define _TRACE_NET_H 7 6 8 #include <linux/skbuff.h> 7 #include <linux/skbuff.h> 9 #include <linux/netdevice.h> 8 #include <linux/netdevice.h> 10 #include <linux/if_vlan.h> << 11 #include <linux/ip.h> 9 #include <linux/ip.h> 12 #include <linux/tracepoint.h> 10 #include <linux/tracepoint.h> 13 11 14 TRACE_EVENT(net_dev_start_xmit, << 15 << 16 TP_PROTO(const struct sk_buff *skb, co << 17 << 18 TP_ARGS(skb, dev), << 19 << 20 TP_STRUCT__entry( << 21 __string( name, << 22 __field( u16, << 23 __field( const void *, << 24 __field( bool, << 25 __field( u16, << 26 __field( u16, << 27 __field( u16, << 28 __field( u8, << 29 __field( unsigned int, << 30 __field( unsigned int, << 31 __field( int, << 32 __field( bool, << 33 __field( int, << 34 __field( u8, << 35 __field( u16, << 36 __field( u16, << 37 __field( u16, << 38 ), << 39 << 40 TP_fast_assign( << 41 __assign_str(name); << 42 __entry->queue_mapping = skb-> << 43 __entry->skbaddr = skb; << 44 __entry->vlan_tagged = skb_vla << 45 __entry->vlan_proto = ntohs(sk << 46 __entry->vlan_tci = skb_vlan_t << 47 __entry->protocol = ntohs(skb- << 48 __entry->ip_summed = skb->ip_s << 49 __entry->len = skb->len; << 50 __entry->data_len = skb->data_ << 51 __entry->network_offset = skb_ << 52 __entry->transport_offset_vali << 53 skb_transport_header_w << 54 __entry->transport_offset = sk << 55 skb_transport_offset(s << 56 __entry->tx_flags = skb_shinfo << 57 __entry->gso_size = skb_shinfo << 58 __entry->gso_segs = skb_shinfo << 59 __entry->gso_type = skb_shinfo << 60 ), << 61 << 62 TP_printk("dev=%s queue_mapping=%u skb << 63 __get_str(name), __entry->qu << 64 __entry->vlan_tagged, __entr << 65 __entry->protocol, __entry-> << 66 __entry->data_len, << 67 __entry->network_offset, __e << 68 __entry->transport_offset, _ << 69 __entry->gso_size, __entry-> << 70 ); << 71 << 72 TRACE_EVENT(net_dev_xmit, 12 TRACE_EVENT(net_dev_xmit, 73 13 74 TP_PROTO(struct sk_buff *skb, 14 TP_PROTO(struct sk_buff *skb, 75 int rc, 15 int rc, 76 struct net_device *dev, 16 struct net_device *dev, 77 unsigned int skb_len), 17 unsigned int skb_len), 78 18 79 TP_ARGS(skb, rc, dev, skb_len), 19 TP_ARGS(skb, rc, dev, skb_len), 80 20 81 TP_STRUCT__entry( 21 TP_STRUCT__entry( 82 __field( void *, 22 __field( void *, skbaddr ) 83 __field( unsigned int, 23 __field( unsigned int, len ) 84 __field( int, 24 __field( int, rc ) 85 __string( name, 25 __string( name, dev->name ) 86 ), 26 ), 87 27 88 TP_fast_assign( 28 TP_fast_assign( 89 __entry->skbaddr = skb; 29 __entry->skbaddr = skb; 90 __entry->len = skb_len; 30 __entry->len = skb_len; 91 __entry->rc = rc; 31 __entry->rc = rc; 92 __assign_str(name); !! 32 __assign_str(name, dev->name); 93 ), 33 ), 94 34 95 TP_printk("dev=%s skbaddr=%p len=%u rc 35 TP_printk("dev=%s skbaddr=%p len=%u rc=%d", 96 __get_str(name), __entry->skba 36 __get_str(name), __entry->skbaddr, __entry->len, __entry->rc) 97 ); 37 ); 98 38 99 TRACE_EVENT(net_dev_xmit_timeout, << 100 << 101 TP_PROTO(struct net_device *dev, << 102 int queue_index), << 103 << 104 TP_ARGS(dev, queue_index), << 105 << 106 TP_STRUCT__entry( << 107 __string( name, << 108 __string( driver, << 109 __field( int, << 110 ), << 111 << 112 TP_fast_assign( << 113 __assign_str(name); << 114 __assign_str(driver); << 115 __entry->queue_index = queue_i << 116 ), << 117 << 118 TP_printk("dev=%s driver=%s queue=%d", << 119 __get_str(name), __get_str(dri << 120 ); << 121 << 122 DECLARE_EVENT_CLASS(net_dev_template, 39 DECLARE_EVENT_CLASS(net_dev_template, 123 40 124 TP_PROTO(struct sk_buff *skb), 41 TP_PROTO(struct sk_buff *skb), 125 42 126 TP_ARGS(skb), 43 TP_ARGS(skb), 127 44 128 TP_STRUCT__entry( 45 TP_STRUCT__entry( 129 __field( void *, 46 __field( void *, skbaddr ) 130 __field( unsigned int, 47 __field( unsigned int, len ) 131 __string( name, 48 __string( name, skb->dev->name ) 132 ), 49 ), 133 50 134 TP_fast_assign( 51 TP_fast_assign( 135 __entry->skbaddr = skb; 52 __entry->skbaddr = skb; 136 __entry->len = skb->len; 53 __entry->len = skb->len; 137 __assign_str(name); !! 54 __assign_str(name, skb->dev->name); 138 ), 55 ), 139 56 140 TP_printk("dev=%s skbaddr=%p len=%u", 57 TP_printk("dev=%s skbaddr=%p len=%u", 141 __get_str(name), __entry->skba 58 __get_str(name), __entry->skbaddr, __entry->len) 142 ) 59 ) 143 60 144 DEFINE_EVENT(net_dev_template, net_dev_queue, 61 DEFINE_EVENT(net_dev_template, net_dev_queue, 145 62 146 TP_PROTO(struct sk_buff *skb), 63 TP_PROTO(struct sk_buff *skb), 147 64 148 TP_ARGS(skb) 65 TP_ARGS(skb) 149 ); 66 ); 150 67 151 DEFINE_EVENT(net_dev_template, netif_receive_s 68 DEFINE_EVENT(net_dev_template, netif_receive_skb, 152 69 153 TP_PROTO(struct sk_buff *skb), 70 TP_PROTO(struct sk_buff *skb), 154 71 155 TP_ARGS(skb) 72 TP_ARGS(skb) 156 ); 73 ); 157 74 158 DEFINE_EVENT(net_dev_template, netif_rx, 75 DEFINE_EVENT(net_dev_template, netif_rx, 159 76 160 TP_PROTO(struct sk_buff *skb), 77 TP_PROTO(struct sk_buff *skb), 161 78 162 TP_ARGS(skb) 79 TP_ARGS(skb) 163 ); 80 ); 164 << 165 DECLARE_EVENT_CLASS(net_dev_rx_verbose_templat << 166 << 167 TP_PROTO(const struct sk_buff *skb), << 168 << 169 TP_ARGS(skb), << 170 << 171 TP_STRUCT__entry( << 172 __string( name, << 173 __field( unsigned int, << 174 __field( u16, << 175 __field( const void *, << 176 __field( bool, << 177 __field( u16, << 178 __field( u16, << 179 __field( u16, << 180 __field( u8, << 181 __field( u32, << 182 __field( bool, << 183 __field( unsigned int, << 184 __field( unsigned int, << 185 __field( unsigned int, << 186 __field( bool, << 187 __field( int, << 188 __field( unsigned char, << 189 __field( u16, << 190 __field( u16, << 191 ), << 192 << 193 TP_fast_assign( << 194 __assign_str(name); << 195 #ifdef CONFIG_NET_RX_BUSY_POLL << 196 __entry->napi_id = skb->napi_i << 197 #else << 198 __entry->napi_id = 0; << 199 #endif << 200 __entry->queue_mapping = skb-> << 201 __entry->skbaddr = skb; << 202 __entry->vlan_tagged = skb_vla << 203 __entry->vlan_proto = ntohs(sk << 204 __entry->vlan_tci = skb_vlan_t << 205 __entry->protocol = ntohs(skb- << 206 __entry->ip_summed = skb->ip_s << 207 __entry->hash = skb->hash; << 208 __entry->l4_hash = skb->l4_has << 209 __entry->len = skb->len; << 210 __entry->data_len = skb->data_ << 211 __entry->truesize = skb->trues << 212 __entry->mac_header_valid = sk << 213 __entry->mac_header = skb_mac_ << 214 __entry->nr_frags = skb_shinfo << 215 __entry->gso_size = skb_shinfo << 216 __entry->gso_type = skb_shinfo << 217 ), << 218 << 219 TP_printk("dev=%s napi_id=%#x queue_ma << 220 __get_str(name), __entry->na << 221 __entry->skbaddr, __entry->v << 222 __entry->vlan_tci, __entry-> << 223 __entry->hash, __entry->l4_h << 224 __entry->data_len, __entry-> << 225 __entry->mac_header_valid, _ << 226 __entry->nr_frags, __entry-> << 227 ); << 228 << 229 DEFINE_EVENT(net_dev_rx_verbose_template, napi << 230 << 231 TP_PROTO(const struct sk_buff *skb), << 232 << 233 TP_ARGS(skb) << 234 ); << 235 << 236 DEFINE_EVENT(net_dev_rx_verbose_template, napi << 237 << 238 TP_PROTO(const struct sk_buff *skb), << 239 << 240 TP_ARGS(skb) << 241 ); << 242 << 243 DEFINE_EVENT(net_dev_rx_verbose_template, neti << 244 << 245 TP_PROTO(const struct sk_buff *skb), << 246 << 247 TP_ARGS(skb) << 248 ); << 249 << 250 DEFINE_EVENT(net_dev_rx_verbose_template, neti << 251 << 252 TP_PROTO(const struct sk_buff *skb), << 253 << 254 TP_ARGS(skb) << 255 ); << 256 << 257 DEFINE_EVENT(net_dev_rx_verbose_template, neti << 258 << 259 TP_PROTO(const struct sk_buff *skb), << 260 << 261 TP_ARGS(skb) << 262 ); << 263 << 264 DECLARE_EVENT_CLASS(net_dev_rx_exit_template, << 265 << 266 TP_PROTO(int ret), << 267 << 268 TP_ARGS(ret), << 269 << 270 TP_STRUCT__entry( << 271 __field(int, ret) << 272 ), << 273 << 274 TP_fast_assign( << 275 __entry->ret = ret; << 276 ), << 277 << 278 TP_printk("ret=%d", __entry->ret) << 279 ); << 280 << 281 DEFINE_EVENT(net_dev_rx_exit_template, napi_gr << 282 << 283 TP_PROTO(int ret), << 284 << 285 TP_ARGS(ret) << 286 ); << 287 << 288 DEFINE_EVENT(net_dev_rx_exit_template, napi_gr << 289 << 290 TP_PROTO(int ret), << 291 << 292 TP_ARGS(ret) << 293 ); << 294 << 295 DEFINE_EVENT(net_dev_rx_exit_template, netif_r << 296 << 297 TP_PROTO(int ret), << 298 << 299 TP_ARGS(ret) << 300 ); << 301 << 302 DEFINE_EVENT(net_dev_rx_exit_template, netif_r << 303 << 304 TP_PROTO(int ret), << 305 << 306 TP_ARGS(ret) << 307 ); << 308 << 309 DEFINE_EVENT(net_dev_rx_exit_template, netif_r << 310 << 311 TP_PROTO(int ret), << 312 << 313 TP_ARGS(ret) << 314 ); << 315 << 316 #endif /* _TRACE_NET_H */ 81 #endif /* _TRACE_NET_H */ 317 82 318 /* This part must be outside protection */ 83 /* This part must be outside protection */ 319 #include <trace/define_trace.h> 84 #include <trace/define_trace.h> 320 85
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.