Linux Kernel Debugging Essentials workshop

33 %
67 %
Information about Linux Kernel Debugging Essentials workshop

Published on February 19, 2014

Author: LubomirRintel



Slides from Linux Kernel Debugging Essentials workshop at base48 Hackerspace. Not really useful by themselves.

Linux Kernel Debugging Essentials Lubomir Rintel base48 Hackerspace, Brno February 19th , 2014 Kernel Debugging February 19th , 2014 1 / 12

Plan Understanding the way kernel can fail Introduction to infrastructure Obtaining & unserstanding the traces Heplful in-kernel mechanisms Building and trying the replacement code Kernel Debugging February 19th , 2014 2 / 12

Kernel failures Warning, possibly non-fatal: OOPS A fatal error: Panic Usually accompained by a state dump Result of a bug or a hardware failure # echo c >/proc/sysrq-trigger Kernel Debugging February 19th , 2014 3 / 12

Kernel configuration Vanilla kernels Distribution kernels Configuration options (build-time) Runtime configuration (sysctls) Boot time configuration (kernel parameters) Documentation/kernel-parameters.txt Kernel Debugging February 19th , 2014 4 / 12

Lab setup For details & non-Fedora setup, see the hackerspace wiki # yum -y install kernel-debug{,-devel} # debuginfo -y install kernel-debug # yum -y install kexec-tools crash Kernel Debugging February 19th , 2014 5 / 12

Console output Message buffer Screen, UART, USB debugging dongle Early console for boot problems Slowed down output possible Syslog via Netpoll API # dmesg rhgb, quiet console={ttyS*,uart} earlyprintk={vga,serial,dbgp} kernel.printk_delay kernel.printk_ratelimit netconsole.ko g_dbgp.ko Kernel Debugging February 19th , 2014 6 / 12

Reading OOPS messages Processor status Traceback # objdump -lSd {vmlinux,module.ko} # addr2line Kernel Debugging February 19th , 2014 7 / 12

Memory dumps Crash dumps OHCI1394 DMA, can be early too Hypervisor specific dumps We can extract console output from them! crashkernel=auto # systemctl start kdump.service # firescope Kernel Debugging February 19th , 2014 8 / 12

Analyzing dumps crash Kernel Debugging February 19th , 2014 9 / 12

Helpful kernel tools Kernel hacking menu Lockdep detector Hung task detector List corruption detector Stack protector Memory poison CONFIG_DEBUG_* kernel.sysrq kernel.*panic* kernel.prove_locking kernel.hung_task_timeout_secs Kernel Debugging February 19th , 2014 10 / 12

Loading our code into kernel Understand kernel coding Pick a good book Linux Kernel Development, Robert Love, Addison-Wesley: Developer’s Library Understanding the Linux Kernel, Corbet et al., O’Reilly (available online) Try out what do the debugging facilities do! # make -C /lib/modules/$(uname -r)/build SUBDIRS=$PWD modules # insmod module.ko Kernel Debugging February 19th , 2014 11 / 12

Thank you for attending! The source to the slides are embedded in the PDF file. Use pdftk or Acrobat Reader’s ”attachments” to extract them. Kernel Debugging February 19th , 2014 12 / 12

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Schulung: Linux Kernel Debugging - Kurse und Schulungen ...

... Linux Kernel Debugging. Linuxhotel Villa Vogelsang. Kursangebot * Terminplan * Arbeitswochenenden * Freakzeit * Eventräume * Hotelzimmer * ...
Read more

Linux kernel live debugging, how it's done and what tools ...

What are the most common and why not uncommon methods and tools used to do live debugging on the Linux kernel? I know that Linus for eg. is against this ...
Read more

Weekend Workshops on Linux Kernel Debugging | Veda Solutions

... designed for Linux Kernel Programmers who are looking for an in-depth coverage on kernel debugging tools and ... Linux Kernel Debugging.
Read more

Linux Device Drivers and Kernel Programming Training ...

... Module Programming Basics * Kernel Debugging Techniques * Accessing ... Internals & Linux Essentials Workshop * Linux Advanced Programming ...
Read more


Read more

Local Kernel-Mode Debugging - Windows 10 hardware dev

For information on setting up local kernel-mode debugging, ... Essentials. Dashboard; Debugging; Samples; Partner with Microsoft; Forums; Community and support
Read more

Training: Linux, UNIX, and Windows; C, C#, C++, XML and ...

New Courses and Workshops: Days: Linux Kernel Debugging: 5: ... Advanced C Programming Workshop: 5: Essential C for C++ Programming: 4: ... Linux Kernel ...
Read more