| 1 | #undef TRACE_SYSTEM
|
| 2 | #define TRACE_SYSTEM qdisc
|
| 3 |
|
| 4 | #if !defined(_TRACE_QDISC_H) || defined(TRACE_HEADER_MULTI_READ)
|
| 5 | #define _TRACE_QDISC_H
|
| 6 |
|
| 7 | #include <linux/skbuff.h>
|
| 8 | #include <linux/netdevice.h>
|
| 9 | #include <linux/tracepoint.h>
|
| 10 | #include <linux/ftrace.h>
|
| 11 | #include <linux/pkt_sched.h>
|
| 12 | #include <net/sch_generic.h>
|
| 13 |
|
| 14 | TRACE_EVENT(qdisc_dequeue,
|
| 15 |
|
| 16 | TP_PROTO(struct Qdisc *qdisc, const struct netdev_queue *txq,
|
| 17 | int packets, struct sk_buff *skb),
|
| 18 |
|
| 19 | TP_ARGS(qdisc, txq, packets, skb),
|
| 20 |
|
| 21 | TP_STRUCT__entry(
|
| 22 | __field( struct Qdisc *, qdisc )
|
| 23 | __field(const struct netdev_queue *, txq )
|
| 24 | __field( int, packets )
|
| 25 | __field( void *, skbaddr )
|
| 26 | __field( int, ifindex )
|
| 27 | __field( u32, handle )
|
| 28 | __field( u32, parent )
|
| 29 | __field( unsigned long, txq_state)
|
| 30 | ),
|
| 31 |
|
| 32 |
|
| 33 | TP_fast_assign(
|
| 34 | __entry->qdisc = qdisc;
|
| 35 | __entry->txq = txq;
|
| 36 | __entry->packets = skb ? packets : 0;
|
| 37 | __entry->skbaddr = skb;
|
| 38 | __entry->ifindex = txq->dev ? txq->dev->ifindex : 0;
|
| 39 | __entry->handle = qdisc->handle;
|
| 40 | __entry->parent = qdisc->parent;
|
| 41 | __entry->txq_state = txq->state;
|
| 42 | ),
|
| 43 |
|
| 44 | TP_printk("dequeue ifindex=%d qdisc handle=0x%X parent=0x%X txq_state=0x%lX packets=%d skbaddr=%p",
|
| 45 | __entry->ifindex, __entry->handle, __entry->parent,
|
| 46 | __entry->txq_state, __entry->packets, __entry->skbaddr )
|
| 47 | );
|
| 48 |
|
| 49 | TRACE_EVENT(qdisc_enqueue,
|
| 50 |
|
| 51 | TP_PROTO(struct Qdisc *qdisc, const struct netdev_queue *txq, struct sk_buff *skb),
|
| 52 |
|
| 53 | TP_ARGS(qdisc, txq, skb),
|
| 54 |
|
| 55 | TP_STRUCT__entry(
|
| 56 | __field(struct Qdisc *, qdisc)
|
| 57 | __field(const struct netdev_queue *, txq)
|
| 58 | __field(void *, skbaddr)
|
| 59 | __field(int, ifindex)
|
| 60 | __field(u32, handle)
|
| 61 | __field(u32, parent)
|
| 62 | ),
|
| 63 |
|
| 64 | TP_fast_assign(
|
| 65 | __entry->qdisc = qdisc;
|
| 66 | __entry->txq = txq;
|
| 67 | __entry->skbaddr = skb;
|
| 68 | __entry->ifindex = txq->dev ? txq->dev->ifindex : 0;
|
| 69 | __entry->handle = qdisc->handle;
|
| 70 | __entry->parent = qdisc->parent;
|
| 71 | ),
|
| 72 |
|
| 73 | TP_printk("enqueue ifindex=%d qdisc handle=0x%X parent=0x%X skbaddr=%p",
|
| 74 | __entry->ifindex, __entry->handle, __entry->parent, __entry->skbaddr)
|
| 75 | );
|
| 76 |
|
| 77 | #undef FN
|
| 78 | #undef FNe
|
| 79 | #define FN(reason) TRACE_DEFINE_ENUM(QDISC_DROP_##reason);
|
| 80 | #define FNe(reason) TRACE_DEFINE_ENUM(QDISC_DROP_##reason);
|
| 81 | DEFINE_QDISC_DROP_REASON(FN, FNe)
|
| 82 |
|
| 83 | #undef FN
|
| 84 | #undef FNe
|
| 85 | #define FN(reason) { QDISC_DROP_##reason, #reason },
|
| 86 | #define FNe(reason) { QDISC_DROP_##reason, #reason }
|
| 87 |
|
| 88 | TRACE_EVENT(qdisc_drop,
|
| 89 |
|
| 90 | TP_PROTO(struct Qdisc *qdisc, const struct netdev_queue *txq,
|
| 91 | struct net_device *dev, struct sk_buff *skb,
|
| 92 | enum qdisc_drop_reason reason),
|
| 93 |
|
| 94 | TP_ARGS(qdisc, txq, dev, skb, reason),
|
| 95 |
|
| 96 | TP_STRUCT__entry(
|
| 97 | __field(struct Qdisc *, qdisc)
|
| 98 | __field(const struct netdev_queue *, txq)
|
| 99 | __field(void *, skbaddr)
|
| 100 | __field(int, ifindex)
|
| 101 | __field(u32, handle)
|
| 102 | __field(u32, parent)
|
| 103 | __field(enum qdisc_drop_reason, reason)
|
| 104 | __string(kind, qdisc->ops->id)
|
| 105 | ),
|
| 106 |
|
| 107 | TP_fast_assign(
|
| 108 | __entry->qdisc = qdisc;
|
| 109 | __entry->txq = txq;
|
| 110 | __entry->skbaddr = skb;
|
| 111 | __entry->ifindex = dev ? dev->ifindex : 0;
|
| 112 | __entry->handle = qdisc->handle;
|
| 113 | __entry->parent = qdisc->parent;
|
| 114 | __entry->reason = reason;
|
| 115 | __assign_str(kind);
|
| 116 | ),
|
| 117 |
|
| 118 | TP_printk("drop ifindex=%d kind=%s handle=0x%X parent=0x%X skbaddr=%p reason=%s",
|
| 119 | __entry->ifindex, __get_str(kind), __entry->handle,
|
| 120 | __entry->parent, __entry->skbaddr,
|
| 121 | __print_symbolic(__entry->reason,
|
| 122 | DEFINE_QDISC_DROP_REASON(FN, FNe)))
|
| 123 | );
|
| 124 |
|
| 125 | #undef FN
|
| 126 | #undef FNe
|
| 127 |
|
| 128 | TRACE_EVENT(qdisc_reset,
|
| 129 |
|
| 130 | TP_PROTO(struct Qdisc *q),
|
| 131 |
|
| 132 | TP_ARGS(q),
|
| 133 |
|
| 134 | TP_STRUCT__entry(
|
| 135 | __string( dev, qdisc_dev(q) ? qdisc_dev(q)->name : "(null)" )
|
| 136 | __string( kind, q->ops->id )
|
| 137 | __field( u32, parent )
|
| 138 | __field( u32, handle )
|
| 139 | ),
|
| 140 |
|
| 141 | TP_fast_assign(
|
| 142 | __assign_str(dev);
|
| 143 | __assign_str(kind);
|
| 144 | __entry->parent = q->parent;
|
| 145 | __entry->handle = q->handle;
|
| 146 | ),
|
| 147 |
|
| 148 | TP_printk("dev=%s kind=%s parent=%x:%x handle=%x:%x", __get_str(dev),
|
| 149 | __get_str(kind), TC_H_MAJ(__entry->parent) >> 16, TC_H_MIN(__entry->parent),
|
| 150 | TC_H_MAJ(__entry->handle) >> 16, TC_H_MIN(__entry->handle))
|
| 151 | );
|
| 152 |
|
| 153 | TRACE_EVENT(qdisc_destroy,
|
| 154 |
|
| 155 | TP_PROTO(struct Qdisc *q),
|
| 156 |
|
| 157 | TP_ARGS(q),
|
| 158 |
|
| 159 | TP_STRUCT__entry(
|
| 160 | __string( dev, qdisc_dev(q)->name )
|
| 161 | __string( kind, q->ops->id )
|
| 162 | __field( u32, parent )
|
| 163 | __field( u32, handle )
|
| 164 | ),
|
| 165 |
|
| 166 | TP_fast_assign(
|
| 167 | __assign_str(dev);
|
| 168 | __assign_str(kind);
|
| 169 | __entry->parent = q->parent;
|
| 170 | __entry->handle = q->handle;
|
| 171 | ),
|
| 172 |
|
| 173 | TP_printk("dev=%s kind=%s parent=%x:%x handle=%x:%x", __get_str(dev),
|
| 174 | __get_str(kind), TC_H_MAJ(__entry->parent) >> 16, TC_H_MIN(__entry->parent),
|
| 175 | TC_H_MAJ(__entry->handle) >> 16, TC_H_MIN(__entry->handle))
|
| 176 | );
|
| 177 |
|
| 178 | TRACE_EVENT(qdisc_create,
|
| 179 |
|
| 180 | TP_PROTO(const struct Qdisc_ops *ops, struct net_device *dev, u32 parent),
|
| 181 |
|
| 182 | TP_ARGS(ops, dev, parent),
|
| 183 |
|
| 184 | TP_STRUCT__entry(
|
| 185 | __string( dev, dev->name )
|
| 186 | __string( kind, ops->id )
|
| 187 | __field( u32, parent )
|
| 188 | ),
|
| 189 |
|
| 190 | TP_fast_assign(
|
| 191 | __assign_str(dev);
|
| 192 | __assign_str(kind);
|
| 193 | __entry->parent = parent;
|
| 194 | ),
|
| 195 |
|
| 196 | TP_printk("dev=%s kind=%s parent=%x:%x",
|
| 197 | __get_str(dev), __get_str(kind),
|
| 198 | TC_H_MAJ(__entry->parent) >> 16, TC_H_MIN(__entry->parent))
|
| 199 | );
|
| 200 |
|
| 201 | #endif
|
| 202 |
|
| 203 |
|
| 204 | #include <trace/define_trace.h>
|