Linux Kernel Debugging Essentials workshop

0 %
100 %
Information about Linux Kernel Debugging Essentials workshop
Technology

Published on February 19, 2014

Author: LubomirRintel

Source: slideshare.net

Description

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

Linux Kernel Debugging Essentials Lubomir Rintel base48 Hackerspace, Brno http://base48.cz/ February 19th , 2014 lkundrak@v3.sk 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 lkundrak@v3.sk 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 lkundrak@v3.sk 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 lkundrak@v3.sk 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 lkundrak@v3.sk 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 lkundrak@v3.sk Kernel Debugging February 19th , 2014 6 / 12

Reading OOPS messages Processor status Traceback # objdump -lSd {vmlinux,module.ko} # addr2line lkundrak@v3.sk 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 lkundrak@v3.sk Kernel Debugging February 19th , 2014 8 / 12

Analyzing dumps crash lkundrak@v3.sk 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 lkundrak@v3.sk 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 lkundrak@v3.sk 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. lkundrak@v3.sk Kernel Debugging February 19th , 2014 12 / 12

Add a comment

Related presentations

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

WIND RIVER SIMICS ESSENTIALS AND ADVANCED DEBUG WORKSHOP

WIND RIVER SIMICS ESSENTIALS AND ADVANCED DEBUG WORKSHOP PREREQUISITE COURSES • None ... bolic debugging, and use remote debugging with GDB and WDB
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