Last active
December 24, 2015 23:58
-
-
Save ctheune/6883842 to your computer and use it in GitHub Desktop.
Debugging kernel issues with perf. Specifically used some of those for debugging our KVM networking issue. Extracted from instructions here: http://comments.gmane.org/gmane.comp.emulators.kvm.devel/113211
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is using perf 3.4 which seems to be a little old and missing some options. | |
Establish probes and start recording: | |
$ perf probe start_xmit | |
$ perf probe virtqueue_kick | |
$ perf record -a -e net:net_dev_xmit -e net:net_dev_queue -e probe:start_xmit -e probe:virtqueue_kick -R& | |
[...attempt to transmit packets inside guest...] | |
$ kill %1 | |
$ perf script -i perf.data | |
Built kernel with CONFIG_DYNAMIC_DEBUG=y | |
$ echo -n 'module virtio_net +p' > /sys/kernel/debug/dynamic_debug/control | |
$ echo -n 'module virtio +p' >/sys/kernel/debug/dynamic_debug/control | |
$ echo 8 > /proc/sys/kernel/printk | |
Generating a core file | |
$ gdb | |
(gdb) generate-core-file [file] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment