5.10. Tuning via /proc Filesystem

 

5.10. Tuning via /proc Filesystem

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.

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."

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.

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"):


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_mcast

Displays, for each network device registered with the kernel, the values of a few parameters used by IP multicast.


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).


softnet_stat

Exports statistics about the software interrupts used by the networking code. See Chapter 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.

 

5.11. Functions and Variables Featured in This Chapter

Table 5-1 summarizes the functions, macros, variables, and data structures introduced in this chapter.

Table 5-1. Functions, macros, variables, and data structures related to system initialization

Name

Description

Functions and macros

request_irq

free_irq

Registers and releases, respectively, a callback handler for an IRQ line. The registration can be exclusive or shared.

request_region

release_region

Allocates and releases I/O ports and I/O memory.

call_usermodehelper

Invokes a user-space helper application.

module_param

Macro used to define configuration parameters for modules.

net_dev_init

Initializes a piece of the networking code at boot time.

Global variables

dev_boot_phase

Boolean flag used by legacy code to enforce the execution of net_dev_init before NIC device drivers register themselves.

irq_desc

Pointer to the vector of IRQ descriptors.

Data structure

 

struct irq_action

Each IRQ line is defined by an instance of this structure. Among other fields, it includes a callback function.

net_device

Describes a network device.

 

 

5.12. Files and Directories Featured in This Chapter

Figure 5-6 lists the files and directories referred to in this chapter.

Figure 5-6. Files and directories featured in this chapter
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值