- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
Linux OS/proc/net/protocols 中的统计信息是什么意思?
cat /proc/net/protocols
protocol size sockets memory press maxhdr slab module cl co di ac io in de sh ss gs se re sp bi br ha uh gp em
PACKET 888 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n
UNIX 752 40 -1 NI 0 yes kernel n n n n n n n n n n n n n n n n n n n
UDP-Lite 816 0 -1 NI 0 yes kernel y y y n y y y n y y y y y n y y y y n
RAW 792 0 -1 NI 0 yes kernel y y y n y y y n y y y y n y y y y n n
UDP 816 4 2 NI 0 yes kernel y y y n y n y n y y y y y n y y y y n
TCP 1656 29 1 no 272 yes kernel y y y y y y y y y y n y n n y y y y y
NETLINK 752 1 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n
最佳答案
里面有每个协议(protocol)的一些统计信息,以及Linux下每个协议(protocol)的总结方法。
不幸的是man 5 proc
在 RHEL 6.5 上没有说明任何关于 /proc/net/protocols
的内容。所以我看了一下来源:http://lxr.free-electrons.com/source/net/core/sock.c?v=2.6.29#L2202和 http://lxr.free-electrons.com/source/include/net/sock.h#L924 .
2169 static void proto_seq_printf(struct seq_file *seq, struct proto *proto)
2170 {
2171 seq_printf(seq, "%-9s %4u %6d %6d %-3s %6u %-3s %-10s "
2172 "%2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c\n",
2173 proto->name,
2174 proto->obj_size,
2175 sock_prot_inuse_get(seq_file_net(seq), proto),
2176 proto->memory_allocated != NULL ? atomic_read(proto->memory_allocated) : -1,
2177 proto->memory_pressure != NULL ? *proto->memory_pressure ? "yes" : "no" : "NI",
2178 proto->max_header,
2179 proto->slab == NULL ? "no" : "yes",
2180 module_name(proto->owner),
2181 proto_method_implemented(proto->close),
2182 proto_method_implemented(proto->connect),
2183 proto_method_implemented(proto->disconnect),
2184 proto_method_implemented(proto->accept),
2185 proto_method_implemented(proto->ioctl),
2186 proto_method_implemented(proto->init),
2187 proto_method_implemented(proto->destroy),
2188 proto_method_implemented(proto->shutdown),
2189 proto_method_implemented(proto->setsockopt),
2190 proto_method_implemented(proto->getsockopt),
2191 proto_method_implemented(proto->sendmsg),
2192 proto_method_implemented(proto->recvmsg),
2193 proto_method_implemented(proto->sendpage),
2194 proto_method_implemented(proto->bind),
2195 proto_method_implemented(proto->backlog_rcv),
2196 proto_method_implemented(proto->hash),
2197 proto_method_implemented(proto->unhash),
2198 proto_method_implemented(proto->get_port),
2199 proto_method_implemented(proto->enter_memory_pressure));
2200 }
所以这是每个协议(protocol)提供的关于自身的信息。
让我们从包含大量“y”和“n”的最后部分开始。
2164 static char proto_method_implemented(const void *method)
2165 {
2166 return method == NULL ? 'n' : 'y';
2167 }
因此,如果特定方法是否在协议(protocol)中实现,这只是信息。例如,“cl”列用于关闭方法。例如,由于 TCP 具有“y”是“关闭”列,因此 TCP 协议(protocol)实现 close() 并且其原型(prototype) strcut 在“关闭”成员中具有非空指针:
924 struct proto {
925 void (*close)(struct sock *sk,
926 long timeout);
输出坑中的一些第一列:
到目前为止,你可以自己看源码
有用的链接:
关于linux -/proc/net/protocols 中的统计信息是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23531519/
在经历了DDOS攻击后,不知何故/proc/kcore非常巨大,我使用一个小的php类来检查当前的磁盘空间,以及已经使用了多少。 它显示以下内容: Total Disk Space: 39.2 GB
所以我从 ruby 移植了一个工具,可以在对象上定义回调 block ,我希望在设置回调的情况下调用它。所以基本上是这样的。 def set_block(&block) @new_kid_on
我定义了两个脚本:第一个脚本调用第二个脚本中的 proc。第二个脚本定义了一个命名空间 fooSpace , 定义了一个变量 fooValue内fooSpace , 并定义了一个过程 myProc内f
使用一个 proc 时,我的脚本工作正常(检索 sftp 提示)。但是当我尝试在 proc 中使用 proc 时,脚本卡住了,我不知道为什么。 请不要重构代码,这不是重点,我需要了解这里的问题。 工作
我想知道是否有一种方法可以识别某些proc文件中用于DMA映射的内存,例如mtrr和iomem,或者通过lspic -vv . 在我的/proc/mtrr中,只有一个无法缓存区域,它似乎几乎指向3.5
我有 2 个过程,它们一个接一个地调用。第一个过程使用 diff 功能并创建 file.txt。压缩文件后的过程。问题是当我运行脚本时,file.txt 是空的。当我注释掉压缩过程时,文件中打印了差异
我曾经认为 /proc/self 和 /proc/$$ 在 bash 终端中是一样的,但现在我发现它们是不同的。 我知道$$是当前进程的pid,/proc/self是当前运行的进程,应该是bash终端
在下面的程序中,我想在第 2 个过程中捕获数据包,而 ping 在第 1 个过程中运行。现在,如果我执行这个程序,proc 正在运行 ping 并退出它。有解决此问题的想法吗? 我的 TCL 代码:
在 proc 中,您可以获得 proc 名称(无需对其进行硬编码)吗?例如 proc my_proc { some_arg } { puts "entering proc [some way
我有一个自定义的 A10 存储库,我试图在其中创建一个能够读取 /proc/[pid]/some-file 的应用程序文件,例如stat和 status ,有点像 ps做。 看完这篇 answer很明
我是 TCL 的新人。我通过 Windows Vista 下的 DOS 窗口“tclsh85 FOD/Scripts/program1.tcl”执行 TCL 代码。 program1.tcl 包含“s
我想查看每个进程的精确内存量用作匿名页,因为匿名内存不能调出,因此精确跟踪此使用情况非常重要。 获取匿名页面总数的一种方法是读取/proc/meminfo AnonPages。 另一种方法是将 sma
在 Ruby 中,Proc.new { 'waffles' } 和 proc { 'waffles' } 之间有什么区别吗?我发现很少有人提到第二种语法。 使用 irb 进行测试,我没有发现任何明显的
我正在寻找有关Linux系统上/proc/net/nf_conntrack和/或/proc/net/ip_contrack文件内容的详细文档。 是的,我知道,有许多实用程序可以用人类可读的格式向我显示
而不是执行多个单独的 PROC FREQ一个非常大的数据集上的程序,我想通过执行单个 PROC FREQ 来提高效率与多个 TABLE声明。我们的 QA 流程需要表格标题,这很简单,只需一个 TABL
我想在 /proc/driver 下创建一个文件目录。我想使用像 proc_root_driver 这样的宏(或提供的其他东西)而不是明确使用“驱动程序/模块名称”。我用 create_proc_en
在 SQL Server 2005 中,我希望名为 LimitedUser 的用户只能运行一个过程: GRANT EXEC ON [usp_RunETL] TO [LimitedUser] 但是,该
考虑到以下两个过程: proc firstOne(): void = echo "X" proc secondOne(): void = echo "X" discard 它们
我想使用 PROC TABULATE 复制 PROC MEANS 的输出。原因是我希望将利润百分比(或利润率)作为 PROC MEANS 输出中的变量之一,但希望抑制一个或多个统计数据的计算,即会有一
我的目标是使数据适合具有正支持的任何分布。 (威 bool (2p)、 Gamma (2p)、帕累托 (2p)、对数正态 (2p)、指数 (1P))。第一次尝试,我使用了 proc univariat
我是一名优秀的程序员,十分优秀!