^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #define TRACE_SYSTEM qdisc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #if !defined(_TRACE_QDISC_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #define _TRACE_QDISC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/netdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/ftrace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/pkt_sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <net/sch_generic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) TRACE_EVENT(qdisc_dequeue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) TP_PROTO(struct Qdisc *qdisc, const struct netdev_queue *txq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) int packets, struct sk_buff *skb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) TP_ARGS(qdisc, txq, packets, skb),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) __field( struct Qdisc *, qdisc )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) __field(const struct netdev_queue *, txq )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) __field( int, packets )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) __field( void *, skbaddr )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) __field( int, ifindex )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) __field( u32, handle )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) __field( u32, parent )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) __field( unsigned long, txq_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) /* skb==NULL indicate packets dequeued was 0, even when packets==1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) __entry->qdisc = qdisc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) __entry->txq = txq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) __entry->packets = skb ? packets : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) __entry->skbaddr = skb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) __entry->ifindex = txq->dev ? txq->dev->ifindex : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) __entry->handle = qdisc->handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) __entry->parent = qdisc->parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) __entry->txq_state = txq->state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) TP_printk("dequeue ifindex=%d qdisc handle=0x%X parent=0x%X txq_state=0x%lX packets=%d skbaddr=%p",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) __entry->ifindex, __entry->handle, __entry->parent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) __entry->txq_state, __entry->packets, __entry->skbaddr )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) TRACE_EVENT(qdisc_reset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) TP_PROTO(struct Qdisc *q),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) TP_ARGS(q),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) __string( dev, qdisc_dev(q) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) __string( kind, q->ops->id )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) __field( u32, parent )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) __field( u32, handle )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) __assign_str(dev, qdisc_dev(q));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) __assign_str(kind, q->ops->id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) __entry->parent = q->parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) __entry->handle = q->handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) TP_printk("dev=%s kind=%s parent=%x:%x handle=%x:%x", __get_str(dev),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) __get_str(kind), TC_H_MAJ(__entry->parent) >> 16, TC_H_MIN(__entry->parent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) TC_H_MAJ(__entry->handle) >> 16, TC_H_MIN(__entry->handle))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) TRACE_EVENT(qdisc_destroy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) TP_PROTO(struct Qdisc *q),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) TP_ARGS(q),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) __string( dev, qdisc_dev(q) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) __string( kind, q->ops->id )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) __field( u32, parent )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) __field( u32, handle )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) __assign_str(dev, qdisc_dev(q));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) __assign_str(kind, q->ops->id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) __entry->parent = q->parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) __entry->handle = q->handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) TP_printk("dev=%s kind=%s parent=%x:%x handle=%x:%x", __get_str(dev),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) __get_str(kind), TC_H_MAJ(__entry->parent) >> 16, TC_H_MIN(__entry->parent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) TC_H_MAJ(__entry->handle) >> 16, TC_H_MIN(__entry->handle))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) TRACE_EVENT(qdisc_create,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) TP_PROTO(const struct Qdisc_ops *ops, struct net_device *dev, u32 parent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) TP_ARGS(ops, dev, parent),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) __string( dev, dev->name )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) __string( kind, ops->id )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) __field( u32, parent )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) __assign_str(dev, dev->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) __assign_str(kind, ops->id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) __entry->parent = parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) TP_printk("dev=%s kind=%s parent=%x:%x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) __get_str(dev), __get_str(kind),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) TC_H_MAJ(__entry->parent) >> 16, TC_H_MIN(__entry->parent))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #endif /* _TRACE_QDISC_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) #include <trace/define_trace.h>