How to debug linux kernel?

1. printk + /proc/sys/kernel/printk
    printk(KERN_DEBUG "I have a dream\n");

    +

echo 8 > /proc/sys/kernel/printk

2. cat / proc / ksyms (kernel symbol table)

GDB 3.
    GDB the vmlinux / proc / kcore (for checking the symbol table)

4. kgdb (remote debugging)

5. magic sysrq key (system hang)

echo 1 > /proc/sys/kernel/sysrq (enable magic sysrq)

6. kdb

7. UML (The User-Mode Linux Port, kernel running in user space, the equivalent of a process)

8. LTT (The Linux Trace Toolkit, suitable for debugging and tracing performance problems)

9. DProbes(Dynamic Probes)

Guess you like

Origin www.cnblogs.com/dakewei/p/12200567.html