Using procinfo

One option to view information in the /proc file system is to monitor the individual files in it. As an alternative, you can use procinfo. The procinfo command displays information from the /proc file system nicely. When used without options, procinfo shows you information about memory usage, CPU load, swap activity, and IRQ usage; see Listing 28-6 for an example. You can also use several options with procinfo to indicate exactly what information you'd like to see.

Listing 28-6. Example procinfo Output SFO:/ # procinfo

Linux ([email protected]) (gcc 4.1.0) #1 1CPU [SFO.]

Memory: Total Used Free Shared Buffers

Mem: 2075400 1553972 521428 0 43716

Swap: 1052216 0 1052216

Bootup: Mon Aug 21 05:58:42 2006 Load average: 0.35 0.29 0.26 1/176 6295

user : 0:19:12.64 6.9% page in : 1105376 disk 1: 31013r 43359w nice : 0:01:01.97 0.4% page out: 317807

system: 0:07:39.15 2.7% page act: 124226

uptime: 4:39:14.77 context : 34328716

irq 0: 4187692 timer irq 8: 47303 rtc irq 1: 62037 i8042 irq 9: 1871 acpi irq 2: 0 cascade [4] irq 10: 1

irq 3: 1 irq 11: 4554524 yenta, ehci_hcd:usb1

irq 4: 1 irq 12: 20566 i8042

irq 5: 1 irq 14: 77226 ide0

irq 7: 1297393 Intel 82801DB-ICH4, irq 15: 136261 ide1

You can use the procinfo command with several options to tune the output it provides. If you think that the default output is not enough, use procinfo -a, which will add to the output of the command a list of all kernel modules, blocks, and character devices as well as file systems that are currently loaded. To refresh the output of procinfo without stopping, you can use the option -f. Table 28-2 lists all other options that you can use with the procinfo command.

Table 28-2. procinfo Options Option Meaning

-f Runs procinfo continuously. This refreshes the procinfo output every five seconds.

-nN Use this option to refresh the procinfo output every n seconds. You can use this option in conjunction with -f only.

-m Shows information about modules and device drivers.

-a Shows all information that procinfo can give.

-d In conjunction with the -f option, this option makes sure that for memory, CPU times, paging, swapping, context, and interrupt statistics, values per second instead of totals are provided.



Option Meaning

-D Is like -d but will show the memory statistics as totals.

-Ffile Redirects output to a file. Specify the name of a TTY to redirect output to a TTY.

-b Shows read and write statistics for disk I/O.

-i Shows the statistics for all IRQs. Ordinarily you will see information for active IRQs only.

-r Shows an extra line to the memory information that shows real free memory. This adds the +/- buffers line that is displayed by the free command as well and that indicates the memory that is immediately accessible for processes on your system.

-v Shows the current version number of the procinfo program.

-h Shows a help message.

Was this article helpful?

0 0

Post a comment