Skip to content

Instantly share code, notes, and snippets.

@Jamlee
Last active April 28, 2022 17:10
Show Gist options
  • Save Jamlee/435d35ea6ed534c7d32a7cb36ce864df to your computer and use it in GitHub Desktop.
Save Jamlee/435d35ea6ed534c7d32a7cb36ce864df to your computer and use it in GitHub Desktop.
stap 脚本
#!/usr/bin/env stap
// Linux 172-19-0-11 5.4.0-109-generic #123-Ubuntu SMP Fri Apr 8 09:10:54 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
//tencent cloud centos 7.2 20220429
// tcp_send_active_reset 检测
probe kernel.statement("*@net/ipv4/tcp.c:2054") {
if (execname() == "node") {
printf("tcp_send_active_reset: %s\n", pp())
}
}
probe kernel.statement("*@net/ipv4/tcp.c:2134") {
if (execname() == "node") {
printf("tcp_send_active_reset: %s\n", pp())
}
}
probe kernel.statement("*@net/ipv4/tcp.c:2153") {
if (execname() == "node") {
printf("tcp_send_active_reset: %s\n", pp())
}
}
probe kernel.statement("*@net/ipv4/tcp.c:2209") {
if (execname() == "node") {
printf("tcp_send_active_reset: %s\n", pp())
}
}
probe kernel.statement("*@net/ipv4/tcp_timer.c:74") {
if (execname() == "node") {
printf("tcp_send_active_reset: %s\n", pp())
}
}
probe kernel.statement("*@net/ipv4/tcp_timer.c:592") {
if (execname() == "node") {
printf("tcp_send_active_reset: %s\n", pp())
}
}
probe kernel.statement("*@net/ipv4/tcp_timer.c:616") {
if (execname() == "node") {
printf("tcp_send_active_reset: %s\n", pp())
}
}
// tcp_v4_send_reset 检测
probe kernel.statement("*@net/ipv4/tcp_ipv4.c:1527") {
if (execname() == "node") {
printf("tcp_v4_send_reset: %s\n", pp())
}
}
probe kernel.statement("*@net/ipv4/tcp_ipv4.c:1764") {
if (execname() == "node") {
printf("tcp_v4_send_reset: %s\n", pp())
}
}
probe kernel.statement("*@net/ipv4/tcp_ipv4.c:1810") {
if (execname() == "node") {
printf("tcp_v4_send_reset: %s\n", pp())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment