Linux内核网络丢包查看工具dropwatch的安装和使用
第一个是 dropwatch
# dropwatch -lkas
Initializing kallsyms db
dropwatch> start
Enabling monitoring...
Kernel monitoring activated.
Issue Ctrl-C to stop monitoring
1 drops at icmp_rcv+11c (0xffffffff8193bb1c) [software]
1 drops at icmp_rcv+11c (0xffffffff8193bb1c) [software]
1 drops at icmp_rcv+11c (0xffffffff8193bb1c) [software]
1 drops at icmp_rcv+11c (0xffffffff8193bb1c) [software]
第二个是 perf 监视 kfree_skb 事件
shell> perf record -g -a -e skb:kfree_skb
shell> perf script
第三个是tcpdrop
Linux bcc/eBPF tcpdrop
第四个是systemtap脚本
/usr/share/doc/systemtap-1.6/examples/network/dropwatch.stp
#!/usr/bin/stap
############################################################
# Dropwatch.stp
# Author: Neil Horman <nhorman@redhat.com>
# An example script to mimic the behavior of the dropwatch utility
# http://fedorahosted.org/dropwatch
############################################################
# Array to hold the list of drop points we find
global locations
# Note when we turn the monitor on and off
probe begin { printf("Monitoring for dropped packets\n") }
probe end { printf("Stopping dropped packet monitor\n") }
# increment a drop counter for every location we drop at
probe kernel.trace("kfree_skb") { locations[$location] <<< 1 }
# Every 1 seconds report our drop locations
probe timer.sec(1)
{
printf("\n")
foreach (l in locations-) {
printf("%d packets dropped at %s\n",
@count(locations[l]), symname(l))
}
delete locations
}
五:tcpdump
· 全网最简单!3分钟用满血DeepSeek R1开发一款AI智能客服,零代码轻松接入微信、公众号、小程
· .NET 10 首个预览版发布,跨平台开发与性能全面提升
· 《HelloGitHub》第 107 期
· 全程使用 AI 从 0 到 1 写了个小工具
· 从文本到图像:SSE 如何助力 AI 内容实时呈现?(Typescript篇)
2018-03-22 大数据平台搭建(hadoop+spark)
2018-03-22 centos7搭建ELK Cluster集群日志分析平台