bpftrace 跟踪 tcp_write_xmit (内核TCP写出提交)

跟踪

bash 复制代码
bpftrace -e '
kprobe:tcp_write_xmit {
  $sk = (struct sock *)arg0;
  $cwnd = ((struct tcp_sock *)$sk)->snd_cwnd;
  $rate = ((struct sock *)$sk)->sk_pacing_rate;
  if ($cwnd > 1000) {
    printf("tcp_write_xmit cwnd=%u pacing=%llu packets_out=%u\n",
      $cwnd, $rate, ((struct tcp_sock *)$sk)->packets_out);
  }
}

跟踪 delivered、snd_wnd

bash 复制代码
bpftrace -e '
kprobe:tcp_write_xmit {
  $sk = (struct sock *)arg0;
  $tp = (struct tcp_sock *)$sk;
  $cwnd = $tp->snd_cwnd;
  $rate = $sk->sk_pacing_rate;
  if ($cwnd > 5000) {
    printf("tcp_write_xmit cwnd=%u pac=%llu out=%u del=%u snd_wnd=%u\n",
      $cwnd, $rate, $tp->packets_out, $tp->delivered, $tp->snd_wnd);
  }
}'
相关推荐
不做菜鸟的网工1 天前
BGP特性
网络协议
MrSYJ2 天前
TCP协议理解
后端·tcp/ip
明月_清风3 天前
开发者网络概念全扫盲:一篇搞定
后端·网络协议
刘马想放假3 天前
Modbus 全栈技术解析:TCP、RTU、ASCII、RTU over TCP
数据结构·网络协议
王二端茶倒水4 天前
一套可落地的无线运营方案,不能只管 AP,还要管用户、计费和运维
网络协议
162723816085 天前
EtherCAT 分布式时钟(DC)原理与配置实战:把多轴真正"对齐到同一时刻"
网络协议
王二端茶倒水5 天前
宽带无线项目,怎么从一次性交付变成长期运营收入?
网络协议
用户2530171996276 天前
第6篇:从技术到产品 — Ghost Proxifier 的设计哲学
网络协议
用户2530171996276 天前
第3篇:注入的艺术 — Ghost Proxifier 核心架构拆解
网络协议