目錄:http://www.cnblogs.com/WuCountry/archive/2008/11/15/1333960.html
[不提供插圖,讀者最好從網上下載源書]
5.10. Tuning via /procs Filesystem 通過/proc檔案系統來調整核心模組
Figure 5-5 shows the files that can be used either to tune or to view the status of configuration parameters related to the topics covered in this chapter.
圖5-5顯示了這些可以用於調整和查看配置狀態的檔案。這些配置狀態參數都會在本章涉及到。
In /proc/sys/kernel are the files modprobe and hotplug that can change the pathnames of the two programs introduced earlier in the section "User-Space Helpers."
在proc/sys/kernle中是一些模組探測檔案和可以修改路徑名的熱插撥裝置。這兩個程式都已經在前面一節“使用者空間助手”講過了。
A few files in /proc export the values within internal data structures and configuration parameters, which are useful to track what resources were allocated by device drivers, shown earlier in the section "Basic Goals of NIC Initialization." For some of these data structures, a user-space command is provided to print their contents in a more user-friendly format. For example, lsmod lists the modules currently loaded, using /proc/modules as its source of information.
在/proc中有一些檔案展示了內部資料結構的值和配置參數,這些資訊可以跟蹤裝置驅動的資源分派情況,這些在前面的章節“NIC初始化的基礎全域變數”已經講過。有些資料結構,有一個使用者空間的命令提供了可以友好方式列印它們內容。例如,lsmod列出當前載入的模組,這是使用/proc/modules作為它的資源資訊。
In /proc/net, you can find the files created by net_dev_init, via dev_proc_init and dev_mcast_init (see the earlier section "Initializing the Device Handling Layer: net_dev_init"):
在proc/net/中,你要以發現一些由net_dev_init通過dev_proc_init和dev_mcast_init建立的檔案,(參見。。。)
dev
Displays, for each network device registered with the kernel, a few statistics about reception and transmission, such as bytes received or transmitted, number of packets, errors, etc.
對於每一個註冊到核心中的裝置,用dev顯示一些關於接收和傳輸的統計資訊,例如接收和傳輸的位元組數,包數,錯誤等。
dev_mcast
Displays, for each network device registered with the kernel, the values of a few parameters used by IP multicast.
顯示一些用於IP多播的參數。
wireless
Similarly to dev, for each wireless device, prints the values of a few parameters from the wireless block returned by the dev->get_wireless_stats virtual function. Note that dev->get_wireless_stats returns something only for wireless devices, because those allocate a data structure to keep those statistics (and so /proc/net/wireless will include only wireless devices).
與dev很類似,對於每一個無線裝置,用於列印無線裝置塊的一些參數,這些資料是通過dev->get_wrieless_stats虛函數返回的。注意到,dev->get_wrieless_stats只為無線裝置的一些資料,因為分配的這些資料結構保留這些統計。
softnet_stat
Exports statistics about the software interrupts used by the networking code. See Chapter 12.
用於暴露一些用於網路代碼的非強制中斷。參見第12章。
Figure 5-5. /proc files related to the routing subsystem
There are other interesting directories, including /proc/drivers, /proc/bus, and /proc/irq, for which I refer you to Linux Device Drivers. In addition, kernel parameters are gradually being moved out of /proc and into a directory called /sys, but I won't describe the new system for lack of space.
這還有其它一些有趣的目錄,包括/proc/drivers,/proc/bus,以及/poc/irq,對於每一個,都推薦去看看Linux裝置驅動開發一書。另外,核心參數已經慢慢的從proc中移出,並添加在一個sys目錄中,因為篇愊有限,這裡不就詳細說明了。