Kernel debug

Train your team to debug kernel!

Our courses are offered in inter-company according to the proposed schedule below. We can also move within your entity. Do not hesitate to ask us for more information!

Course objectives

The common point of any platform operating under Linux, server, workstation, embedded hardware, is undoubtedly the Linux kernel. The tests or the implementation of such platforms in more or less extreme conditions or on more or less exotic material quite often lead to situations of partial blocking (oops) or total (panic) of the core. The debug kernel training proposes to explore with the participant the system that underlies the functioning of the kernel to better understand it and to know the related sources of information. It also offers tools and methods to collect the information needed for the last phase, which consists in analyzing the problem encountered. The participant is then able to either correct the malfunction or to transmit all of this information to the competent level. saving time on this analysis phase. Know the sources of information related to the operation of the Linux kernel.
  • To know how to collect in an exhaustive way the information related to a dysfunction of the nucleus.
  • Know how to analyze the collected information.

Target

Prerequisites for this training:
  • knowledge of the Linux system
  • basic knowledge in C

Practical

  • Duration : 2 days
  • Level : beginner
  • Objective: To know how to gather in an exhaustive way the information related to a dysfunction of the nucleus and to analyze the information thus collected
  • Price : 1 400€ HT

The training will alternate theoretical contributions and implementation of each concept discussed. The participants will work on both actual bug reports but also on crash simulations using the emulator qemu. The experience of participants will also be used to provide information on a problem encountered.
File systems and debug
  • Virtual file system procfs
  • Sysfs virtual file system
  • Collect debug information with debugfs
  • Persistently store information with pstore
Debug user space
  • Recover a core dump
  • Use gdb
  • Detection of head corruption with heap / alloc
Kernel errors and dialog with the kernel
  • cktrace
  • warn
  • Kernel tainted – list of flags
  • Oops
  • switchgrass
  • bug
Configure your kernel to improve the debug
  • debug info
  • kdump / kexec
  • Configuration of spin lock, mutex, use of locks
  • printk

The tools of debug kernel
  • system.map
  • Set up a serial console
  • Specificities of using a serial console under Xen
  • Setting up a netconsole
  • Use qemu to debug
  • kgbd (serial port)
  • crash / kdump
  • The importance of the camera
  • Tracing / ftrace
  • Some useful kernel parameters: panic = oops, vga =, earlyprintk =, ignore_loglevel, initcall_debug, log_buf_len
Analyze the information collected
  • Identify memory addresses with addr2line
  • gdb, the swiss debugging knife
  • An analysis tool dedicated to the kernel: crash
  • Analysis tool: printk
  • Define a message format with pr_ *
  • Extract the device and its driver with dev_ *
  • printk versus dev_ *?
Arnaud PATARD is co-founder of hupstream. Fan of Open Source, packager, he also contributed to kernel.org He worked at Mandriva Linux and led ports on architectures such as ARM and MIPC.

Our next training dates

  • 28 and 29 january 2019, Paris
  • 14 and 15 march 2019, Paris
  • 03 and 04 june 2019, Paris
  • 16 and 17 september 2019, Paris
  • 28 and 29 november 2019, Paris

Ask for a quote