Hello,
I am new with CentOs, and more familiar with small linux kernel Sdk. I would like to ask if it is possible to kernel debug ( and kernel module debug in particular) CentOs kernel module, and how ? I am using I7 Intel architrecture.
Best Regards, Ran
On Nov 7, 2015, at 4:03 AM, Ran Shalit ranshalit@gmail.com wrote:
I am new with CentOs, and more familiar with small linux kernel Sdk. I would like to ask if it is possible to kernel debug ( and kernel module debug in particular) CentOs kernel module, and how ? I am using I7 Intel architrecture.
You can install the kernel-debug package with the same version of the kernel that you are debugging, it’ll contain a vmlinux built the same as the non-debug version, just with the debugging symbols included.
Are you interested in debugging a kernel crash core? or use some of the kernel trace/probes to examine a running kernel?
-- Jonathan Billings billings@negate.org
On Sat, Nov 7, 2015 at 4:24 PM, Jonathan Billings billings@negate.org wrote:
On Nov 7, 2015, at 4:03 AM, Ran Shalit ranshalit@gmail.com wrote:
I am new with CentOs, and more familiar with small linux kernel Sdk. I would like to ask if it is possible to kernel debug ( and kernel module debug in particular) CentOs kernel module, and how ? I am using I7 Intel architrecture.
You can install the kernel-debug package with the same version of the kernel that you are debugging, it’ll contain a vmlinux built the same as the non-debug version, just with the debugging symbols included.
Thanks for this value information! As to the steps after prepearing vmlinux for debug: I also find the following important link: https://github.com/AltraMayor/XIA-for-Linux/wiki/Debugging-the-Linux-kernel But it seems that the kernel debugging metod described there is quite complex (qeuires virtualbox , nfs shared folder). I just wander if this is the method which is recommended & used for kernel module debugging.
Are you interested in debugging a kernel crash core? or use some of the kernel trace/probes to examine a running kernel?
I am intereseted in debugging a new kernel module which I will write (v4l pci express module)
Regards, Ran
On Nov 7, 2015, at 2:56 PM, Ran Shalit ranshalit@gmail.com wrote:
Thanks for this value information! As to the steps after prepearing vmlinux for debug: I also find the following important link: https://github.com/AltraMayor/XIA-for-Linux/wiki/Debugging-the-Linux-kernel But it seems that the kernel debugging metod described there is quite complex (qeuires virtualbox , nfs shared folder). I just wander if this is the method which is recommended & used for kernel module debugging.
Odd that it would suggest VirtualBox when kvm-based VMs are native to the kernel. I’d use virsh to do the same thing, with fewer moving parts.
I am intereseted in debugging a new kernel module which I will write (v4l pci express module)
It sounds like you’re going to be debugging a kernel module for physical hardware? That makes a lot of the above URL useless — you want to use kdbg from a serial console attached to a physical system rather than a VM.
-- Jonathan Billings billings@negate.org
On Sun, Nov 8, 2015 at 1:22 AM, Jonathan Billings billings@negate.org wrote:
On Nov 7, 2015, at 2:56 PM, Ran Shalit ranshalit@gmail.com wrote:
Thanks for this value information! As to the steps after prepearing vmlinux for debug: I also find the following important link: https://github.com/AltraMayor/XIA-for-Linux/wiki/Debugging-the-Linux-kernel But it seems that the kernel debugging metod described there is quite complex (qeuires virtualbox , nfs shared folder). I just wander if this is the method which is recommended & used for kernel module debugging.
Odd that it would suggest VirtualBox when kvm-based VMs are native to the kernel. I’d use virsh to do the same thing, with fewer moving parts.
Right. probably virsh is good enough with CentOS.
I am intereseted in debugging a new kernel module which I will write (v4l pci express module)
It sounds like you’re going to be debugging a kernel module for physical hardware? That makes a lot of the above URL useless — you want to use kdbg from a serial console attached to a physical system rather than a VM.
Yes, I am testing HW: PCI express device (connected to FPGA) for video stream. I think that the above suggestion is useful becuase it is probably for anyone who want to debug kernel with one machine instead of 2 physical machines. But at the bottom line, both configuration (2 phisical machines or 1 physical machine and 1 VM) is seems complex. I would probably rather use printk in the end....
Thank you! Ran
On Sat, 7 Nov 2015 09:24:33 -0500 Jonathan Billings billings@negate.org wrote:
On Nov 7, 2015, at 4:03 AM, Ran Shalit ranshalit@gmail.com wrote:
I am new with CentOs, and more familiar with small linux kernel Sdk. I would like to ask if it is possible to kernel debug ( and kernel module debug in particular) CentOs kernel module, and how ? I am using I7 Intel architrecture.
You can install the kernel-debug package with the same version of the kernel that you are debugging, it’ll contain a vmlinux built the same as the non-debug version, just with the debugging symbols included.
If one wants debugging information it's the "kernel-debuginfo" you should install. kernel-debug is a kernel built with different config (lots of debugging enabled). It will be a quite different experience.. (most notably slower).
/Peter K