WALL-E / Practice

练习手册
0 stars 0 forks source link

dropwatch 网络协议栈丢包检查利器 #11

Open WALL-E opened 7 years ago

WALL-E commented 7 years ago

安装

yum install dropwatch
WALL-E commented 7 years ago

举个栗子

dropwatch -l kas

dropwatch
WALL-E commented 7 years ago

关键代码

Call trace_consume_skb() instead of trace_kfree_skb() as skbs are removed from the completion_queue during transmit. This avoids false positives from dropwatch/drop_monitor making them more useful.

if (likely(get_kfree_skb_cb(skb)->reason == SKB_REASON_CONSUMED))
                                trace_consume_skb(skb);
                        else
                                trace_kfree_skb(skb, net_tx_action);
WALL-E commented 7 years ago

也许 perf 也能完成相同的事情,这应该是大概率时间。

WALL-E commented 7 years ago

img