Training > Linux Kernel Development > Linux Kernel Debugging (LFD445)
Image Image INSTRUCTOR-LED COURSE

Linux Kernel Debugging (LFD445)

Master Linux kernel debugging to become an indispensable asset in the tech industry. This course equips you with the skills to solve complex problems, unlocking new career opportunities and enhancing your value to both your team and company.

Image
Who Is It For

This course is designed for current or aspiring kernel developers, device driver developers, and anyone interested in shortening the development cycle by taking advantage of existing tools and facilities.
read less read more
Image
What You’ll Learn

You will learn techniques for local debugging by configuring a system (physical or virtual) for remote debugging from a second system and working with the basic components of the Linux kernel that underlie the built-in debugging frameworks.
read less read more
Image
What It Prepares You For

To deliver improved productivity in Linux kernel development environments by diagnosing and fixing kernel issues more efficiently.
read less read more
Course Outline
Expand All
Collapse All
Image Introduction
- Objectives
- Who You Are
- The Linux Foundation
- Copyright and No Confidential Information
- The Linux Foundation Training
- Certification Programs and Digital Badging
- The Linux Foundation THRIVE-ONE Subscriptions
- Linux Distributions
- Platforms
- Preparing Your System
- Using and Downloading a Virtual Machine
- Things Change in Linux and Open Source Projects
- Documentation and Links
Image Preliminaries
- Procedures
- Kernel Versions
- Kernel Sources and Use of git
- Hardware
- Staging Tree
- Labs
Image How to Work in OSS Projects **
- Overview on How to Contribute Properly
- Know Where the Code is Coming From: DCO and CLA
- Stay Close to Mainline for Security and Quality
- Study and Understand the Project DNA
- Figure Out What Itch You Want to Scratch
- Identify Maintainers and Their Work Flows and Methods
- Get Early Input and Work in the Open
- Contribute Incremental Bits, Not Large Code Dumps
- Leave Your Ego at the Door: Don't Be Thin-Skinned
- Be Patient, Develop Long Term Relationships, Be Helpful
Image Debugging Overview
- What is Debugging?
- OOPS and Panic Messages
- Output in dmesg
- Hidden Errors
- Course Flow
Image OOPS Messages
- What is an Oops Message?
- Finding the Code That Triggered the Oops
- Putting it All Together
- Background - Modules **
- Background - Module Compilation **
- Background - Macros and Inlined Functions **
- Lab Exercises
Image Oops Messages With Source Code
- Without Source Code
- With Source Code - Compiling
- With Source Code - Disassembly
- Summary
Image Kernel Features
- Components of the Kernel
- User-Space vs. Kernel-Space
- What are System Calls?
- Available System Calls
- Scheduling Algorithms and Task Structures
- Process Context
- Labs
Image Kernel Programming Preview
- Task Structure
- Memory Allocation
- Transferring Data between User and Kernel Spaces
- Object-Oriented Inheritance - Sort Of
- Linked Lists
- Jiffies
- Labs
Image Kernel Deprecated Interfaces
- Why Deprecated
- __deprecated
- BUG() and BUG_ON()
- Computed Sizes for kmalloc()
- simple_strtol() Family of Routines
- strcpy(), strncpy(), strlcpy()
- printk() %p Format Specifier
- Variable Length Arrays
- Switch Case Fall-Through
- Zero-Length and One-Element Arrays in Structs
Image Race Conditions and Synchronization Methods
- Concurrency and Synchronization Methods
- Atomic Operations
- Bit Operations
- Spinlocks
- Seqlocks
- Disabling Preemption
- Mutexes
- Semaphores
- Completion Functions
- Read-Copy-Update (RCU)
- Reference Counts
- Labs
Image Process Address Space
- Allocating User Memory and Address Spaces
- Locking Pages
- Memory Descriptors and Regions
- Access Rights
- Allocating and Freeing Memory Regions
- Page Faults
- Labs
Image Printk
- Debugging with printk
- Format Specifiers in printk
- no_hash_pointers Command Line Option
- Using early_printk
- Labs
Image Kernel Initialization
- Overview of System Initialization
- System Boot
- Das U-Boot for Embedded Systems**
- Kernel Startup
Image Monitoring and Debugging
- Debuginfo Packages
- Tracing and Profiling
- sysctl
- SysRq Key
- oops Messages
- Kernel Debuggers
- debugfs
- Labs
Image Ftrace
- What is ftrace?
- ftrace, trace-cmd and kernelshark
- Available Tracers
- Using ftrace
- Files in the Tracing Directory
- Tracing Options
- Printing with trace_printk()
- Trace Markers
- Dumping the Buffer
- trace-cmd
- Labs
Image Kernel and git Bisection
- What is kernel bisection?
- Bisection basics
- Scripting kernel bisection
- Labs
Image Kernel Development Tools
- KASAN
- KCSAN
- KFENCE
- Kmemleak
- KMSAN
- UBSAN
- Summary
Image Perf
- What is perf?
- perf list
- perf stat
- perf record
- perf report
- perf annotate
- perf top
- Labs
Image kprobes
- kprobes
- kretprobes
- SystemTap **
- Labs
Image eBPF
- BPF
- eBPF
- Installation
- bcc Tools
- bpftrace
- Labs
Image QEMU
- What is QEMU?
- Emulated Architectures
- Image Formats
- Third Party Hypervisor Integration
- Labs
Image Linux Kernel Debugging Tools
- Linux Kernel (built-in) tools and helpers
- kdb
- qemu+gdb
- kgdb: hardware+serial+gdb
- Labs
Image Crash
- Crash
- Main Commands
- Labs
Image Kernel gdb Scripts
- Kernel gdb Scripts
- Setup
- Commands
- Functions
- Labs
Image kexec
- kexec
- Kernel Configuration
- kexec-tools
- Using kexec
- Labs
Image Kernel Core Dumps
- Producing and Analyzing Kernel Core Dumps
- Labs
Image Closing and Evaluation Survey
- Evaluation Survey
Image Kernel Architecture I
- UNIX and Linux **
- Monolithic and Micro Kernels
- Object-Oriented Methods
- Main Kernel Components
- User-Space and Kernel-Space
Image System Calls
- What are System Calls?
- Available System Calls
- How System Calls are Implemented
- Adding a New System Call
- Labs
Image Kernel Style and General Considerations
- Coding Style
- Using Generic Kernel Routines and Methods
- Making a Kernel Patch
- sparse
- Using likely() and unlikely()
- Writing Portable Code, CPU, 32/64-bit, Endianness
- Writing for SMP
- Writing for High Memory Systems
- Power Management
- Keeping Security in Mind
- Labs
Image The proc Filesystem **
- What is the proc Filesystem?
- Creating and Removing Entries
- Reading and Writing Entries
- The seq_file Interface **
- Labs
Image Unified Device Model and sysfs
- Unified Device Model
- Basic Structures
- Real Devices
- sysfs
- kset and kobject examples
- Labs

**
These sections may be considered in part or in whole as optional. They contain either background reference material, specialized topics, or advanced subjects. The instructor may choose to cover or not cover them depending on classroom experience and time constraints.
Prerequisites
To make the most of this course, you should:

  • Be proficient in the C programming language.
  • Be familiar with basic Linux (UNIX) utilities such as ls, grep and tar.
  • Be comfortable using any of the available text editors (e.g. emacs, vi, etc.).
  • Experience with any major Linux distribution is helpful but not strictly required.
  • Have experience equivalent to having taken Linux Kernel Internals and Development (LFD420).
Lab Info
Systems should have 2+ CPUs and 4GB+ of RAM, as verified by the ready-for.sh script; the more resources available, the faster and smoother the labs will be.
Reviews
Jun 2025
I like the up-to-date information on recent kernels, and that everything is compactly compiled in the booklet.
Mar 2025
I became familiar with most of the kernel concepts and debug tools, and learnt about each concept in depth.
Feb 2025
Fantastic overview of tools and methods used for testing in the kernel.