net_sched: introduce tracepoint trace_qdisc_enqueue()
authorQitao Xu <qitao.xu@bytedance.com>
Thu, 15 Jul 2021 06:03:24 +0000 (23:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Jul 2021 17:32:38 +0000 (10:32 -0700)
commit70713dddf3d25a02d1952f8c5d2688c986d2f2fb
tree31d54d7e6bef0ca4e69b4e09ee3c34ea050ede7d
parent851f36e40962408309ad2665bf0056c19a97881c
net_sched: introduce tracepoint trace_qdisc_enqueue()

Tracepoint trace_qdisc_enqueue() is introduced to trace skb at
the entrance of TC layer on TX side. This is similar to
trace_qdisc_dequeue():

1. For both we only trace successful cases. The failure cases
   can be traced via trace_kfree_skb().

2. They are called at entrance or exit of TC layer, not for each
   ->enqueue() or ->dequeue(). This is intentional, because
   we want to make trace_qdisc_enqueue() symmetric to
   trace_qdisc_dequeue(), which is easier to use.

The return value of qdisc_enqueue() is not interesting here,
we have Qdisc's drop packets in ->dequeue(), it is impossible to
trace them even if we have the return value, the only way to trace
them is tracing kfree_skb().

We only add information we need to trace ring buffer. If any other
information is needed, it is easy to extend it without breaking ABI,
see commit 3dd344ea84e1 ("net: tracepoint: exposing sk_family in all
tcp:tracepoints").

Reviewed-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Qitao Xu <qitao.xu@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/trace/events/qdisc.h
net/core/dev.c