[译]5.10. Tuning via /procs Filesystem 通过/proc文件系统来调整内核模块
目录: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目录中,因为篇愊有限,这里不就详细说明了。
/\_/\
(=^o^=) Wu.Country@侠缘
(~)@(~) 一辈子,用心做一件事!
--------------------------------
学而不思则罔,思而不学则怠!
================================
posted on 2009-03-01 14:40 Wu.Country@侠缘 阅读(431) 评论(0) 编辑 收藏 举报