proc.txt
来自「Linux Kernel 2.6.9 for OMAP1710」· 文本 代码 · 共 1,564 行 · 第 1/5 页
TXT
1,564 行
Adaptec SCSI BIOS: Enabled IRQ: 10 SCBs: Active 0, Max Active 2, Allocated 15, HW 16, Page 255 Interrupts: 160328 BIOS Control Word: 0x18b6 Adapter Control Word: 0x005b Extended Translation: Enabled Disconnect Enable Flags: 0xffff Ultra Enable Flags: 0x0001 Tag Queue Enable Flags: 0x0000 Ordered Queue Tag Flags: 0x0000 Default Tag Queue Depth: 8 Tagged Queue By Device array for aic7xxx host instance 0: {255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255} Actual queue depth per device for aic7xxx host instance 0: {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} Statistics: (scsi0:0:0:0) Device using Wide/Sync transfers at 40.0 MByte/sec, offset 8 Transinfo settings: current(12/8/1/0), goal(12/8/1/0), user(12/15/1/0) Total transfers 160151 (74577 reads and 85574 writes) (scsi0:0:6:0) Device using Narrow/Sync transfers at 5.0 MByte/sec, offset 15 Transinfo settings: current(50/15/0/0), goal(50/15/0/0), user(50/15/0/0) Total transfers 0 (0 reads and 0 writes) 1.6 Parallel port info in /proc/parport---------------------------------------The directory /proc/parport contains information about the parallel ports ofyour system. It has one subdirectory for each port, named after the portnumber (0,1,2,...).These directories contain the four files shown in Table 1-8.Table 1-8: Files in /proc/parport .............................................................................. File Content autoprobe Any IEEE-1284 device ID information that has been acquired. devices list of the device drivers using that port. A + will appear by the name of the device currently using the port (it might not appear against any). hardware Parallel port's base address, IRQ line and DMA channel. irq IRQ that parport is using for that port. This is in a separate file to allow you to alter it by writing a new value in (IRQ number or none). ..............................................................................1.7 TTY info in /proc/tty-------------------------Information about the available and actually used tty's can be found in thedirectory /proc/tty.You'll find entries for drivers and line disciplines inthis directory, as shown in Table 1-9.Table 1-9: Files in /proc/tty .............................................................................. File Content drivers list of drivers and their usage ldiscs registered line disciplines driver/serial usage statistic and status of single tty lines ..............................................................................To see which tty's are currently in use, you can simply look into the file/proc/tty/drivers: > cat /proc/tty/drivers pty_slave /dev/pts 136 0-255 pty:slave pty_master /dev/ptm 128 0-255 pty:master pty_slave /dev/ttyp 3 0-255 pty:slave pty_master /dev/pty 2 0-255 pty:master serial /dev/cua 5 64-67 serial:callout serial /dev/ttyS 4 64-67 serial /dev/tty0 /dev/tty0 4 0 system:vtmaster /dev/ptmx /dev/ptmx 5 2 system /dev/console /dev/console 5 1 system:console /dev/tty /dev/tty 5 0 system:/dev/tty unknown /dev/tty 4 1-63 console 1.8 Miscellaneous kernel statistics in /proc/stat-------------------------------------------------Various pieces of information about kernel activity are available in the/proc/stat file. All of the numbers reported in this file are aggregatessince the system first booted. For a quick look, simply cat the file: > cat /proc/stat cpu 2255 34 2290 22625563 6290 127 456 cpu0 1132 34 1441 11311718 3675 127 438 cpu1 1123 0 849 11313845 2614 0 18 intr 114930548 113199788 3 0 5 263 0 4 [... lots more numbers ...] ctxt 1990473 btime 1062191376 processes 2915 procs_running 1 procs_blocked 0The very first "cpu" line aggregates the numbers in all of the other "cpuN"lines. These numbers identify the amount of time the CPU has spent performingdifferent kinds of work. Time units are in USER_HZ (typically hundredths of asecond). The meanings of the columns are as follows, from left to right:- user: normal processes executing in user mode- nice: niced processes executing in user mode- system: processes executing in kernel mode- idle: twiddling thumbs- iowait: waiting for I/O to complete- irq: servicing interrupts- softirq: servicing softirqsThe "intr" line gives counts of interrupts serviced since boot time, for eachof the possible system interrupts. The first column is the total of allinterrupts serviced; each subsequent column is the total for that particularinterrupt.The "ctxt" line gives the total number of context switches across all CPUs.The "btime" line gives the time at which the system booted, in seconds sincethe Unix epoch.The "processes" line gives the number of processes and threads created, whichincludes (but is not limited to) those created by calls to the fork() andclone() system calls.The "procs_running" line gives the number of processes currently running onCPUs.The "procs_blocked" line gives the number of processes currently blocked,waiting for I/O to complete.------------------------------------------------------------------------------Summary------------------------------------------------------------------------------The /proc file system serves information about the running system. It not onlyallows access to process data but also allows you to request the kernel statusby reading files in the hierarchy.The directory structure of /proc reflects the types of information and makesit easy, if not obvious, where to look for specific data.------------------------------------------------------------------------------------------------------------------------------------------------------------CHAPTER 2: MODIFYING SYSTEM PARAMETERS------------------------------------------------------------------------------------------------------------------------------------------------------------In This Chapter------------------------------------------------------------------------------* Modifying kernel parameters by writing into files found in /proc/sys* Exploring the files which modify certain parameters* Review of the /proc/sys file tree------------------------------------------------------------------------------A very interesting part of /proc is the directory /proc/sys. This is not onlya source of information, it also allows you to change parameters within thekernel. Be very careful when attempting this. You can optimize your system,but you can also cause it to crash. Never alter kernel parameters on aproduction system. Set up a development machine and test to make sure thateverything works the way you want it to. You may have no alternative but toreboot the machine once an error has been made.To change a value, simply echo the new value into the file. An example isgiven below in the section on the file system data. You need to be root to dothis. You can create your own boot script to perform this every time yoursystem boots.The files in /proc/sys can be used to fine tune and monitor miscellaneous andgeneral things in the operation of the Linux kernel. Since some of the filescan inadvertently disrupt your system, it is advisable to read bothdocumentation and source before actually making adjustments. In any case, bevery careful when writing to any of these files. The entries in /proc maychange slightly between the 2.1.* and the 2.2 kernel, so if there is any doubtreview the kernel documentation in the directory /usr/src/linux/Documentation.This chapter is heavily based on the documentation included in the pre 2.2kernels, and became part of it in version 2.2.1 of the Linux kernel.2.1 /proc/sys/fs - File system data-----------------------------------This subdirectory contains specific file system, file handle, inode, dentryand quota information.Currently, these files are in /proc/sys/fs:dentry-state------------Status of the directory cache. Since directory entries are dynamicallyallocated and deallocated, this file indicates the current status. It holdssix values, in which the last two are not used and are always zero. The othersare listed in table 2-1.Table 2-1: Status files of the directory cache .............................................................................. File Content nr_dentry Almost always zero nr_unused Number of unused cache entries age_limit in seconds after the entry may be reclaimed, when memory is short want_pages internally ..............................................................................dquot-nr and dquot-max----------------------The file dquot-max shows the maximum number of cached disk quota entries.The file dquot-nr shows the number of allocated disk quota entries and thenumber of free disk quota entries.If the number of available cached disk quotas is very low and you have a largenumber of simultaneous system users, you might want to raise the limit.file-nr and file-max--------------------The kernel allocates file handles dynamically, but doesn't free them again atthis time.The value in file-max denotes the maximum number of file handles that theLinux kernel will allocate. When you get a lot of error messages about runningout of file handles, you might want to raise this limit. The default value is10% of RAM in kilobytes. To change it, just write the new number into thefile: # cat /proc/sys/fs/file-max 4096 # echo 8192 > /proc/sys/fs/file-max # cat /proc/sys/fs/file-max 8192 This method of revision is useful for all customizable parameters of thekernel - simply echo the new value to the corresponding file.Historically, the three values in file-nr denoted the number of allocated filehandles, the number of allocated but unused file handles, and the maximumnumber of file handles. Linux 2.6 always reports 0 as the number of free filehandles -- this is not an error, it just means that the number of allocatedfile handles exactly matches the number of used file handles.Attempts to allocate more file descriptors than file-max are reported withprintk, look for "VFS: file-max limit <number> reached".inode-state and inode-nr------------------------The file inode-nr contains the first two items from inode-state, so we'll skipto that file...inode-state contains two actual numbers and five dummy values. The numbersare nr_inodes and nr_free_inodes (in order of appearance).nr_inodes~~~~~~~~~Denotes the number of inodes the system has allocated. This number willgrow and shrink dynamically.nr_free_inodes--------------Represents the number of free inodes. Ie. The number of inuse inodes is(nr_inodes - nr_free_inodes).super-nr and super-max----------------------Again, super block structures are allocated by the kernel, but not freed. Thefile super-max contains the maximum number of super block handlers, wheresuper-nr shows the number of currently allocated ones.Every mounted file system needs a super block, so if you plan to mount lots offile systems, you may want to increase these numbers.aio-nr and aio-max-nr---------------------aio-nr is the running total of the number of events specified on theio_setup system call for all currently active aio contexts. If aio-nrreaches aio-max-nr then io_setup will fail with EAGAIN. Note thatraising aio-max-nr does not result in the pre-allocation or re-sizingof any kernel data structures.2.2 /proc/sys/fs/binfmt_misc - Miscellaneous binary formats-----------------------------------------------------------Besides these files, there is the subdirectory /proc/sys/fs/binfmt_misc. Thishandles the kernel support for miscellaneous binary formats.Binfmt_misc provides the ability to register additional binary formats to theKernel without compiling an additional module/kernel. Therefore, binfmt_miscneeds to know magic numbers at the beginning or the filename extension of thebinary.It works by maintaining a linked list of structs that contain a description ofa binary format, including a magic with size (or the filename extension),offset and mask, and the interpreter name. On request it invokes the giveninterpreter with the original program as argument, as binfmt_java andbinfmt_em86 and binfmt_mz do. Since binfmt_misc does not define any defaultbinary-formats, you have to register an additional binary-format.There are two general files in binfmt_misc and one file per registered format.The two general files are register and status.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?