Kernel Debugging

kernel menuconfig

Kernel hacking
    printk and dmesg options  --->
    Compile-time checks and compiler options  --->
-*- Magic SysRq key
(0x1) Enable magic SysRq key functions by default
-*- Kernel debugging
    Memory Debugging  --->
[ ] Debug shared IRQ handlers
    Debug Lockups and Hangs  --->
[ ] Panic on Oops
(0) panic timeout
[*] Collect scheduler debugging info
[ ] Collect scheduler statistics
[ ] Detect stack corruption on calls to schedule()
[*] Collect kernel timers statistics
[ ] Debug preemptible kernel
    Lock Debugging (spinlocks, mutexes, etc...)  --->
-*- Stack backtrace support
[ ] kobject debugging
[*] Verbose BUG() reporting (adds 70K)
[ ] Debug linked list manipulation
[ ] Debug priority linked list manipulation
[ ] Debug SG table operations
[ ] Debug notifier call chains
[ ] Debug credential management
    RCU Debugging  --->
[ ] Force extended block device numbers and spread them
< > Notifier error injection
[ ] Fault-injection framework
[*] Tracers  --->
    Runtime Testing  --->
[ ] Enable debugging of DMA-API usage
< > Test module loading with 'hello world' module
< > Test user/kernel boundary protections
< > Test BPF filter functionality
< > Test firmware loading via userspace interface
< > udelay test driver
[ ] Sample kernel code  ----
[*] KGDB: kernel debugger  --->
[ ] Export kernel pagetable layout to userspace via debugfs
[ ] Filter access to /dev/mem
[*] Enable stack unwinding support (EXPERIMENTAL)
[ ] Verbose user fault messages
[ ] Kernel low-level debugging functions (read help!)
< > Kprobes test module
[ ] Write the current PID to the CONTEXTIDR register
[ ] Set loadable kernel module data as NX and text as RO
[ ] CoreSight Tracing Support  ----

Debug File System (CONFIG_DEBUG_FS)

  • 커널 메뉴 설정에서 아래가 체크되어야 한다.
    Kernel hacking ––>
    → Compile-time checks and compiler options ––>
    → [*] Debug filesystem
  • Debugfs 는 마운트되어야 사용할 수 있다.
    (mount -t debugfs none /sys/kernel/debug)
  • /sys/kernel/debug/debug_objects/stats을 통해 통계 정보를 알 수 있다.

참고

댓글 남기기