mib.mbufs
来自「ftam等标准协议服务器和客户端的源代码。」· MBUFS 代码 · 共 62 行
MBUFS
62 行
BEGIN { MSIZE = 128; MCLBYTES = 1024; keys[0] = "free"; keys[1] = "data"; keys[2] = "packet headers"; keys[3] = "socket structures"; keys[4] = "protocol control blocks"; keys[5] = "routing tables"; keys[6] = "IMP host tables"; keys[7] = "address resolution tables"; keys[8] = "socket names"; keys[9] = "zombie process status"; keys[10] = "socket options"; keys[11] = "fragment reassembly headers"; keys[12] = "access rights"; keys[13] = "interface addresses"; total = 0; inuse = 0; didany = 0; for (i in mbufs) { didany = 1; i = mbufs; j = mbufFrees; if (i == 0) { printf "no mbufs!?!\n"; exit(1); } if (j == 0) j = mbufAllocates[0]; printf "%d/%d mbufs in use:\n", i - j, i; total += i * MSIZE; inuse += (i - j) * MSIZE; didone = 0; for (i in mbufType) { didone = 1; if (mbufAllocates) { if (i == 0) continue; printf "\t%d mbufs allocated to ", mbufAllocates; if (k = keys[mbufType]) printf "%s\n", k; else printf "mbuf type %d\n", mbufType; } } if (!didone && DIAGNOSTIC) printf "mbufTable: %s\n", DIAGNOSTIC; i = mbufClusters; j = mbufFreeClusters printf "%d/%d mapped pages in use\n", i - j, i; total += i * MCLBYTES; inuse += (i - j) * MCLBYTES; printf "%d Kbytes allocated to network (%d%% in use)\n", total / 1024, (inuse * 100) / total; printf "%d requests for memory denied\n", mbufDrops; printf "%d interface pages obtained from page pool\n", mbufSpaces; printf "%d requests for memory delayed\n", mbufWaits; printf "%d calls to protocol drain routines\n", mbufDrains; } if (!didany && DIAGNOSTIC) printf "mbuf group: %s\n", DIAGNOSTIC; }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?