جزییات کتاب
Debug Linux kernel modules and the kernel itself by mastering powerful open source tools and advanced kernel debugging techniquesKey FeaturesLearn how to use a variety of kernel and module debug tools and techniques with the help of examplesUnderstand how to expertly interpret a kernel oops and identify the underlying defectsIncludes easy-to-look up tables and simplified explanations of complex kernel-level defectsBook DescriptionThe Linux kernel is at the very core of arguably the world’s best production-quality OS. Debugging it, though, can be a complex endeavor. Linux Kernel Debugging is a thorough guide to advanced kernel debugging.This book covers a range of debugging techniques in detail, starting with instrumentation-based debugging techniques, the kernel's powerful Kprobes framework, printk, and friends. The book features two whole chapters devoted to the tools and techniques for debugging memory-related bugs. It also prepares you to interpret the underlying issue when the Linux kernel throws an oops. As you advance through the chapters, you'll be able to demystify concurrency by learning what data races are and how to handle them, including the use of modern features like Kernel Concurrency Sanitizer (KCSAN). You'll also discover how to overcome some thorny issues related to debugging and performance through detailed kernel-level tracing and learn to wield the power of Ftrace and its frontends. What's more? The book shows you how to deal with kernel hangs and panic, leverage the venerable GDB tool within the kernel, and much more.By the time you complete reading this debugging kernel book, you'll have at your disposal, a whole range of powerful debug tools and techniques, along with a keen sense as to when to use which.What you will learnInstrumentation-based printk and the powerful dynamic debug frameworkUse Kprobes statically and dynamically to trap into kernel or module functionsCatch kernel memory defects with KASAN, UBSAN, SLUB debug, and kmemleakPrecisely identify the source location of kernel and module bugsUnderstand data races and use KCSAN to catch evasive concurrency defectsLeverage Ftrace and trace-cmd to trace the kernel flow in great detailWrite a custom kernel panic handler using the WD and hangcheck timerLearn to use KGDB to single-step and debug kernel or module source codeWho This Book Is ForThis book is for Linux kernel developers, module or driver authors, and testers interested in debugging and enhancing their Linux systems at the level of the kernel. System administrators who want to understand and debug the internal infrastructure of their Linux kernels will also find this book useful. A good hold of C programming and the Linux command line is necessary. Some experience with module or kernel development will be beneficial too.Table of ContentsA General Introduction to Debugging SoftwareApproaches to Kernel DebuggingDebugging via Instrumentation - printk and friendsDebugging via Instrumentation – Using KprobesDebugging Kernel Memory Issues – Part 1Debugging Kernel Memory Issues – Part 2Oops! Interpreting the Kernel Bug DiagnosticLock DebuggingTracing the Kernel FlowKernel Panic, Hangcheck, and WatchdogsUsing KGDBOther Approaches to Kernel Debugging