Debugging the kernel using Ftrace
Posted: Fri May 30, 2014 12:14 am
For example debugging Mac-on-Linux/KVM with Ftrace.
Ftrace shows the events that lead up to a crash. It gives a better chance of finding exactly what caused it and can help the developer in creating the correct solution.
Ftrace shows the events that lead up to a crash. It gives a better chance of finding exactly what caused it and can help the developer in creating the correct solution.
- First you need the kernel 3.14.4 with ftrace support. Download: vmlinux-3.14.4-KVM-PR-FTRACE-AmigaOneX1000.tar.bz2
- After the start of the new kernel 3.14.4, the directory /sys/kernel/debug will be created. To mount
this directory, you can add to your /etc/fstab file:
Or you can mount it at run time with:Code: Select all
debugfs /sys/kernel/debug debugfs defaults 0 0
Code: Select all
mount -t debugfs nodev /sys/kernel/debug
- Change to the directory /sys/kernel/debug/tracing
Code: Select all
cd /sys/kernel/debug/tracing/
- Activate the function graph tracer:
Code: Select all
echo function_graph > current_tracer
- Start Mac OS X with startmol -X
- Show the kernel KVM events:
Code: Select all
cat trace | head -20