Koki Sanagi | cf66ba5 | 2010-08-23 18:45:02 +0900 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM net |
| 3 | |
| 4 | #if !defined(_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_NET_H |
| 6 | |
| 7 | #include <linux/skbuff.h> |
| 8 | #include <linux/netdevice.h> |
Ben Hutchings | d87d04a | 2014-01-10 22:17:03 +0000 | [diff] [blame^] | 9 | #include <linux/if_vlan.h> |
Koki Sanagi | cf66ba5 | 2010-08-23 18:45:02 +0900 | [diff] [blame] | 10 | #include <linux/ip.h> |
| 11 | #include <linux/tracepoint.h> |
| 12 | |
Ben Hutchings | d87d04a | 2014-01-10 22:17:03 +0000 | [diff] [blame^] | 13 | TRACE_EVENT(net_dev_start_xmit, |
| 14 | |
| 15 | TP_PROTO(const struct sk_buff *skb, const struct net_device *dev), |
| 16 | |
| 17 | TP_ARGS(skb, dev), |
| 18 | |
| 19 | TP_STRUCT__entry( |
| 20 | __string( name, dev->name ) |
| 21 | __field( u16, queue_mapping ) |
| 22 | __field( const void *, skbaddr ) |
| 23 | __field( bool, vlan_tagged ) |
| 24 | __field( u16, vlan_proto ) |
| 25 | __field( u16, vlan_tci ) |
| 26 | __field( u16, protocol ) |
| 27 | __field( u8, ip_summed ) |
| 28 | __field( unsigned int, len ) |
| 29 | __field( unsigned int, data_len ) |
| 30 | __field( int, network_offset ) |
| 31 | __field( bool, transport_offset_valid) |
| 32 | __field( int, transport_offset) |
| 33 | __field( u8, tx_flags ) |
| 34 | __field( u16, gso_size ) |
| 35 | __field( u16, gso_segs ) |
| 36 | __field( u16, gso_type ) |
| 37 | ), |
| 38 | |
| 39 | TP_fast_assign( |
| 40 | __assign_str(name, dev->name); |
| 41 | __entry->queue_mapping = skb->queue_mapping; |
| 42 | __entry->skbaddr = skb; |
| 43 | __entry->vlan_tagged = vlan_tx_tag_present(skb); |
| 44 | __entry->vlan_proto = ntohs(skb->vlan_proto); |
| 45 | __entry->vlan_tci = vlan_tx_tag_get(skb); |
| 46 | __entry->protocol = ntohs(skb->protocol); |
| 47 | __entry->ip_summed = skb->ip_summed; |
| 48 | __entry->len = skb->len; |
| 49 | __entry->data_len = skb->data_len; |
| 50 | __entry->network_offset = skb_network_offset(skb); |
| 51 | __entry->transport_offset_valid = |
| 52 | skb_transport_header_was_set(skb); |
| 53 | __entry->transport_offset = skb_transport_offset(skb); |
| 54 | __entry->tx_flags = skb_shinfo(skb)->tx_flags; |
| 55 | __entry->gso_size = skb_shinfo(skb)->gso_size; |
| 56 | __entry->gso_segs = skb_shinfo(skb)->gso_segs; |
| 57 | __entry->gso_type = skb_shinfo(skb)->gso_type; |
| 58 | ), |
| 59 | |
| 60 | TP_printk("dev=%s queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x vlan_tci=0x%04x protocol=0x%04x ip_summed=%d len=%u data_len=%u network_offset=%d transport_offset_valid=%d transport_offset=%d tx_flags=%d gso_size=%d gso_segs=%d gso_type=%#x", |
| 61 | __get_str(name), __entry->queue_mapping, __entry->skbaddr, |
| 62 | __entry->vlan_tagged, __entry->vlan_proto, __entry->vlan_tci, |
| 63 | __entry->protocol, __entry->ip_summed, __entry->len, |
| 64 | __entry->data_len, |
| 65 | __entry->network_offset, __entry->transport_offset_valid, |
| 66 | __entry->transport_offset, __entry->tx_flags, |
| 67 | __entry->gso_size, __entry->gso_segs, __entry->gso_type) |
| 68 | ); |
| 69 | |
Koki Sanagi | cf66ba5 | 2010-08-23 18:45:02 +0900 | [diff] [blame] | 70 | TRACE_EVENT(net_dev_xmit, |
| 71 | |
| 72 | TP_PROTO(struct sk_buff *skb, |
Koki Sanagi | ec764bf | 2011-05-30 21:48:34 +0000 | [diff] [blame] | 73 | int rc, |
| 74 | struct net_device *dev, |
| 75 | unsigned int skb_len), |
Koki Sanagi | cf66ba5 | 2010-08-23 18:45:02 +0900 | [diff] [blame] | 76 | |
Koki Sanagi | ec764bf | 2011-05-30 21:48:34 +0000 | [diff] [blame] | 77 | TP_ARGS(skb, rc, dev, skb_len), |
Koki Sanagi | cf66ba5 | 2010-08-23 18:45:02 +0900 | [diff] [blame] | 78 | |
| 79 | TP_STRUCT__entry( |
| 80 | __field( void *, skbaddr ) |
| 81 | __field( unsigned int, len ) |
| 82 | __field( int, rc ) |
Koki Sanagi | ec764bf | 2011-05-30 21:48:34 +0000 | [diff] [blame] | 83 | __string( name, dev->name ) |
Koki Sanagi | cf66ba5 | 2010-08-23 18:45:02 +0900 | [diff] [blame] | 84 | ), |
| 85 | |
| 86 | TP_fast_assign( |
| 87 | __entry->skbaddr = skb; |
Koki Sanagi | ec764bf | 2011-05-30 21:48:34 +0000 | [diff] [blame] | 88 | __entry->len = skb_len; |
Koki Sanagi | cf66ba5 | 2010-08-23 18:45:02 +0900 | [diff] [blame] | 89 | __entry->rc = rc; |
Koki Sanagi | ec764bf | 2011-05-30 21:48:34 +0000 | [diff] [blame] | 90 | __assign_str(name, dev->name); |
Koki Sanagi | cf66ba5 | 2010-08-23 18:45:02 +0900 | [diff] [blame] | 91 | ), |
| 92 | |
| 93 | TP_printk("dev=%s skbaddr=%p len=%u rc=%d", |
| 94 | __get_str(name), __entry->skbaddr, __entry->len, __entry->rc) |
| 95 | ); |
| 96 | |
| 97 | DECLARE_EVENT_CLASS(net_dev_template, |
| 98 | |
| 99 | TP_PROTO(struct sk_buff *skb), |
| 100 | |
| 101 | TP_ARGS(skb), |
| 102 | |
| 103 | TP_STRUCT__entry( |
| 104 | __field( void *, skbaddr ) |
| 105 | __field( unsigned int, len ) |
| 106 | __string( name, skb->dev->name ) |
| 107 | ), |
| 108 | |
| 109 | TP_fast_assign( |
| 110 | __entry->skbaddr = skb; |
| 111 | __entry->len = skb->len; |
| 112 | __assign_str(name, skb->dev->name); |
| 113 | ), |
| 114 | |
| 115 | TP_printk("dev=%s skbaddr=%p len=%u", |
| 116 | __get_str(name), __entry->skbaddr, __entry->len) |
| 117 | ) |
| 118 | |
| 119 | DEFINE_EVENT(net_dev_template, net_dev_queue, |
| 120 | |
| 121 | TP_PROTO(struct sk_buff *skb), |
| 122 | |
| 123 | TP_ARGS(skb) |
| 124 | ); |
| 125 | |
| 126 | DEFINE_EVENT(net_dev_template, netif_receive_skb, |
| 127 | |
| 128 | TP_PROTO(struct sk_buff *skb), |
| 129 | |
| 130 | TP_ARGS(skb) |
| 131 | ); |
| 132 | |
| 133 | DEFINE_EVENT(net_dev_template, netif_rx, |
| 134 | |
| 135 | TP_PROTO(struct sk_buff *skb), |
| 136 | |
| 137 | TP_ARGS(skb) |
| 138 | ); |
| 139 | #endif /* _TRACE_NET_H */ |
| 140 | |
| 141 | /* This part must be outside protection */ |
| 142 | #include <trace/define_trace.h> |