General System Information

Not only the subdirectories of /proc contain information but also the directory itself. General information relating to no specific kernel subsystem (or shared by several subsystems) resides in files in /proc.

Some of these files were mentioned in earlier chapters. For example, iomem and ioports provide information on memory addresses and ports used to communicate with devices, as discussed in Chapter 6. Both files contain lists in text form:

[email protected]> c 00000000-0009dbff : 00000000-00000000 0009dc00-0009ffff : 000c0000-000cffff : 000e4000-000fffff : 00100000-cff7ffff : 00200000-004017a4 004017a5-004ffdef it /proc/iomem System RAM : Crash kernel reserved pnp 00:0d reserved System RAM : Kernel code : Kernel data cff80000-cff8dfff : ACPI Tables cff8e000-cffdffff : ACPI Non-volatile Storage cffe0000-cfffffff : reserved d0000000-dfffffff : PCI Bus #01 d0000000-dfffffff : 0000:01:00.0 d0000000-d0ffffff : vesafb fee00000-fee00fff : Local APIC

ffa00000-ffafffff : pnp 00:07

fff00000-ffffffff : reserved 100000000-12fffffff : System RAM

[email protected]> cat /proc/ioports

0000-001f 0020-0021 0040-0043 0050-0053 0060-006f 0070-0077 0080-008f 00a0-00a1

dmal picl timerO

timerl keyboard rtc dma page reg pic2

e400-e40f : libata e480-e483 : 0000:03:00.0

e480-e483 : libata e800-e807 : 0000:03:00.0

e800-e807 : libata e880-e883 : 0000:03:00.0

e880-e883 : libata ec00-ec07 : 0000:03:00.0 ec00-ec07 : libata

Similarly, some files provide a rough overview of the current memory management situation. buddyinfo and slabinfo supply data on current utilization of the buddy system and slab allocator, and meminfo gives an overview of general memory usage — broken down into high and low memory, free, allocated and shared areas, swap and writeback memory, and so on. vmstat yields further memory management characteristics including the number of pages currently in each memory management subsystem.

The kallsyms and kcore entries support kernel code debugging. The former holds a table with the addresses of all global kernel variables and procedures including their addresses in memory:

[email protected]> cat /proc/kallsyms ffffffff80395ce8 T skb_abort_seq_read ffffffff80395cff t skb_ts_finish ffffffff80395d08 T skb_find_text ffffffff80395d76 T skb_to_sgvec ffffffff80395f6d T skb_truesize_bug ffffffff80395f89 T skb_under_panic ffffffff80395fe4 T skb_over_panic ffffffff8039603f t copy_skb_header ffffffff80396273 T skb_pull_rcsum ffffffff803962da T skb_seq_read ffffffff80396468 t skb_ts_get_next_block kcore is a dynamic core file that "contains" all data of the running kernel — that is, the entire contents of main memory. It is no different from the normal core files that are saved for debugging purposes when a fatal error in user applications generates a core dump. The current state of a running system can be inspected using a debugger together with the binary file. Many of the figures in this book illustrating the interplay among the kernel data structures were prepared using this method. Appendix 2 takes a closer look at how available capabilities can be used with the help of the GNU gdb debugger and the ddd graphical user interface.

interrupts saves the number of interrupts raised during the current operation (the underlying mechanism is described in Chapter 14). On an IA-32 quad-core server, the file could look like this:

[email protected]> cat /proc/interrupts

CPU0

CPU1

CPU2

CPU3

0

1383211

1407764

1292884

1364817

IO-APIC-edge

timer

1

0

1

1

0

IO-APIC-edge

i8042

8

0

1

0

0

IO-APIC-edge

rtc

9

0

0

0

0

IO-APIC-fasteoi

acpi

12

1

3

0

0

IO-APIC-edge

i8042

16

8327

4251

290975

114077

IO-APIC-fasteoi

libata, uhci_hcd:usb1

18

0

1

0

0

IO-APIC-fasteoi

ehci_hcd:usb2, uhci_hcd:usb4, uhci_hcd:usb7

19

0

0

0

0

IO-APIC-fasteoi

uhci_hcd:usb6

21

0

0

0

0

IO-APIC-fasteoi

uhci_hcd:usb3

22

267439

93114

10575

5018

IO-APIC-fasteoi

libata, libata, HDA Intel

23

0

0

0

0

IO-APIC-fasteoi

uhci_hcd:usb5, ehci_hcd:usb8

4347: 12

17

7

77445

PCI-MSI-edge

eth0

NMI

0

0

0

0

LOC

5443482

5443174

5446374

5446306

ERR

0

Not only the number of interrupts but also the name of the device or driver responsible for the interrupt are given for each interrupt number.

Last but not least, I must mention loadavg and uptime, which display, respectively, the average system loading (i.e., the length of the run queue) during the last 60 seconds, 5 minutes, and 15 minutes; and the system uptime — the time elapsed since system boot.

Continue reading here: Network Information

Was this article helpful?

0 0