Kernel debugging essentials workshop: Difference between revisions
imported>Klubko mNo edit summary |
imported>Klubko mNo edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 36: | Line 36: | ||
# <code>apt-get -y install kdump-tools crash git linux-headers linux-image-$(uname -r)-dbg linux-source ncurses-dbg</code> | # <code>apt-get -y install kdump-tools crash git linux-headers linux-image-$(uname -r)-dbg linux-source ncurses-dbg</code> | ||
| | | | ||
# <code>pkcon install kernel{-debug,}{-devel} kexec-tools crash git gcc ncurses-devel | # <code>pkcon install kernel{-debug,}{-devel,} kexec-tools crash git gcc ncurses-devel | ||
debuginfo-install -y kernel{-debug,}</code> | debuginfo-install -y kernel{-debug,}</code> | ||
|} | |} | ||
Line 104: | Line 104: | ||
== Materials == | == Materials == | ||
Work-in-progress slides. Content will be extended and polished (as I learn beamer...), but outline will stay roughly the same: [[File:kernel-workshop | Work-in-progress slides. Content will be extended and polished (as I learn beamer...), but outline will stay roughly the same: [[File:kernel-workshop.pdf.gz]] | ||
* https://github.com/lkundrak/sad-ugly-and-broken This is a repository for variously broken kernel code, for demonstration | * https://github.com/lkundrak/sad-ugly-and-broken This is a repository for variously broken kernel code, for demonstration | ||
* https://github.com/lkundrak/kexec-tools Patched kexec-tools, for >= 3.11 kernels | * https://github.com/lkundrak/kexec-tools Patched kexec-tools, for >= 3.11 kernels | ||
* http://v3.sk/~lkundrak/firescope/ Firewire debugging tool | * http://v3.sk/~lkundrak/firescope/ Firewire debugging tool |
Latest revision as of 10:31, 19 February 2014
Topics
We'll be holding a workshop on basics of finding and debugging (and eventually fixing) common issues with Linux kernel.
Topics I'd initially cover would include leveraging in-kernel debugging facilities, techniques for capturing debug output from various crashes, understanding the captured data, and modifying, building and loading the altered kernel code with more debugging code or an actual fix.
Original mailing list reference: [1]
Requirements
- Some elementary knowledge of C
- A laptop with Linux (Fedora 20 preferred, Debian 7 fine, we'll try to cover older versions and other distribution too) and root access, 2G + size of RAM free space
- If you don't have any available, please let me know in advance
Language
I'm fine with holding the workshop in English language if there's anyone who doesn't speak Czech/Slovak.
Setup instructions
Please prepare your laptop in advance so that we don't waste too much time at the workshop.
Extra hardware will be available for ones who won't be able to bring their own laptops.
Install required packages
Debian | Fedora |
---|---|
|
|
Get the kernel source tree
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Cheatsheet
Here are some distro-dependent details. I'll be using Fedora, follow these to translate to Debian equivalents if you're running Debian.
These are here just for reference, no need to follow these prior to the workshop.
Enable kdump
Debian | Fedora |
---|---|
|
or
|
Enable netconsole
Debian | Fedora |
---|---|
|
|
Running crash
The location of the raw vmlinux
binary from the debugging packages differs in distros.
Debian | Fedora |
---|---|
|
|
Materials
Work-in-progress slides. Content will be extended and polished (as I learn beamer...), but outline will stay roughly the same: File:Kernel-workshop.pdf.gz
- https://github.com/lkundrak/sad-ugly-and-broken This is a repository for variously broken kernel code, for demonstration
- https://github.com/lkundrak/kexec-tools Patched kexec-tools, for >= 3.11 kernels
- http://v3.sk/~lkundrak/firescope/ Firewire debugging tool