0

我正在尝试运行此脚本,但它没有显示任何 tcp 连接任何想法?操作系统:centos 6.3

#! /usr/bin/env stap

probe begin {
  printf("%6s %16s %6s %6s %16s\n",
         "UID", "CMD", "PID", "PORT", "IP_SOURCE")
}

probe kernel.function("tcp_accept").return?,
      kernel.function("inet_csk_accept").return? {
  sock = $return
  if (sock != 0)
    printf("%6d %16s %6d %6d %16s\n", uid(), execname(), pid(),
           inet_get_local_port(sock), inet_get_ip_source(sock))
}

输出:

[root@server src]# ./tcp_con.stp 
   Missing separate debuginfos, use: debuginfo-install kernel-2.6.32-279.1.1.el6.centos.plus.x86_64 
   UID              CMD    PID   PORT        IP_SOURCE
4

1 回答 1

2

按照 systemtap 的建议安装 kernel-debuginfo。两个 kernel.function() 探测后的问号让 stap 悄悄地放弃这两个。

于 2012-11-28T13:47:45.910 回答