Linux Debugging 2 - System Profiling

来源:互联网 发布:淘宝上那家卖警服 编辑:程序博客网 时间:2024/06/01 19:37

1. The /proc filesystem

 

一个表示进程的虚拟文件系统,每个进程一个目录,名字是进程号,里面存有关于一个进程的各种信息,可以监管一个进程,依据map和fd信息做出诊断。同时/proc也可用于控制和诊断核心以及硬件。

 

1) kernel and hardware 诊断信息

refer : http://blog.chinaunix.net/u/31/showart_602243.html

例如: APM(advanced power management), execdomains(registered execution domains), fb(frame buffer information).

2) kernel tunable parameters /proc/sys 例如,

3) 进程诊断信息

 

2. 中断

the following table shows the IRQ#, number of interrupts, responsible PIC, and registered handler.

 

/proc/stat的内容如下,

 

 

interrupts are per-process, and in SMP, multiple interrupts can be handled concurrently by the different CPUs.

 

3. /proc/kallsyms : all expoted module symbols from the kernel, and module name is in []

 

 

the symbols are entry points, which are used primarily by insmod when modules are inserted, and another use of ksyms is to map kernel structures when peeking into the kernel memory, by using /dev/kmem.

 

4. Dmesg (print or control the kernel ring buffer)

 

kernel messages may be rerouted to user mode via klogd.

 

in /var/log,

 

5. Devices

/sys for devices/modules just like /proc for processes.

 

6. 2 kind processes

migration(runqueue -> idle) and watchdog(make sure cpu active)