Linux Kernel Debugging: Leverage proven tools and advanced techniques to effectively debug Linux kernels and kernel modules (Paperback)

N. Billimoria, Kaiwan

  • 出版商: Packt Publishing
  • 出版日期: 2022-08-05
  • 售價: $1,800
  • 貴賓價: 9.5$1,710
  • 語言: 英文
  • 頁數: 638
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1801075034
  • ISBN-13: 9781801075039
  • 相關分類: Linux
  • 立即出貨 (庫存 < 4)

買這商品的人也買了...

商品描述

Effectively debug kernel modules, device drivers, and the kernel itself by gaining a solid understanding of powerful open source tools and advanced kernel debugging techniques

Key Features

- Fully understand how to use a variety of kernel and module debugging tools and techniques using examples
- Learn to expertly interpret a kernel Oops and identify underlying defect(s)
- Use easy-to-look up tables and clear explanations of kernel-level defects to make this complex topic easy

Book Description

The 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 comprehensive guide to learning all about advanced kernel debugging. This book covers many areas in-depth, such as instrumentation-based debugging techniques (printk and the dynamic debug framework), and shows you how to use Kprobes. Memory-related bugs tend to be a nightmare – two chapters are packed with tools and techniques devoted to debugging them. When the kernel gifts you an Oops, how exactly do you interpret it to be able to debug the underlying issue? We've got you covered. Concurrency tends to be an inherently complex topic, so a chapter on lock debugging will help you to learn precisely what data races are, including using KCSAN to detect them. Some thorny issues, both debug- and performance-wise, require detailed kernel-level tracing; you'll learn to wield the impressive power of Ftrace and its frontends. You'll also discover how to handle kernel lockups, hangs, and the dreaded kernel panic, as well as leverage the venerable GDB tool within the kernel (KGDB), along with much more.

By the end of this book, you will have at your disposal a wide range of powerful kernel debugging tools and techniques, along with a keen sense of when to use which.

What you will learn

- Explore instrumentation-based printk along with the powerful dynamic debug framework
- Use static and dynamic Kprobes to trap into kernel/module functions
- Catch kernel memory defects with KASAN, UBSAN, SLUB debug, and kmemleak
- Interpret an Oops in depth and precisely identify it's source location
- Understand data races and use KCSAN to catch evasive concurrency defects
- Leverage Ftrace and trace-cmd to trace the kernel flow in great detail
- Write a custom kernel panic handler and detect kernel lockups and hangs
- Use KGDB to single-step and debug kernel/module source code

Who this book is for

This book is for Linux kernel developers, module/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 grasp on C programming and the Linux command line is necessary. Some experience with kernel (module) development will help you follow along.

商品描述(中文翻譯)

有效地透過瞭解強大的開源工具和高級內核調試技術,來調試內核模塊、設備驅動程序和內核本身。

主要特點:

- 通過示例全面了解使用各種內核和模塊調試工具和技術
- 學會精確解讀內核 Oops 並識別潛在缺陷
- 使用易於查閱的表格和清晰的內核級缺陷解釋,使這個複雜的主題變得容易

書籍描述:

Linux 內核是可以說是世界上最好的生產質量操作系統的核心。然而,調試它可能是一個復雜的任務。

《Linux 內核調試》是一本全面指南,教你如何學習高級內核調試。本書深入介紹了許多領域,例如基於儀器的調試技術(printk 和動態調試框架),並展示了如何使用 Kprobes。與內存相關的錯誤往往是一個噩夢 - 兩章充滿了用於調試這些錯誤的工具和技術。當內核出現 Oops 時,你如何解釋它以便能夠調試底層問題?我們為你提供了解答。並發性往往是一個本質上復雜的主題,所以一章關於鎖調試將幫助你準確了解數據競爭,包括使用 KCSAN 檢測它們。一些棘手的問題,無論是調試還是性能方面,都需要詳細的內核級追蹤;你將學會使用 Ftrace 及其前端工具的強大功能。你還將了解如何處理內核死機、卡住和可怕的內核恐慌,以及如何在內核中使用古老的 GDB 工具(KGDB)等等。

通過閱讀本書,你將掌握各種強大的內核調試工具和技術,並且將對何時使用哪種工具有敏銳的認識。

你將學到什麼:

- 探索基於儀器的 printk 和強大的動態調試框架
- 使用靜態和動態 Kprobes 來捕獲內核/模塊函數
- 使用 KASAN、UBSAN、SLUB 調試和 kmemleak 捕獲內核內存缺陷
- 深入解讀 Oops,並精確識別其源位置
- 理解數據競爭,並使用 KCSAN 捕獲逃避的並發缺陷
- 利用 Ftrace 和 trace-cmd 以極大的細節追蹤內核流程
- 編寫自定義內核恐慌處理程序,並檢測內核死機和卡住
- 使用 KGDB 進行單步調試內核/模塊源代碼

本書適合對調試和增強 Linux 系統內核感興趣的 Linux 內核開發人員、模塊/驅動程序作者和測試人員。希望了解和調試其 Linux 內核內部基礎架構的系統管理員也會發現本書有用。需要具備 C 編程和 Linux 命令行的良好掌握能力。有一些內核(模塊)開發經驗將有助於你跟上本書的內容。

目錄大綱

1. A General Introduction to Debugging Software
2. Approaches to Kernel Debugging
3. Debug via Instrumentation – printk and Friends
4. Debug via Instrumentation – Kprobes
5. Debugging Kernel Memory Issues – Part 1
6. Debugging Kernel Memory Issues – Part 2
7. Oops! Interpreting the Kernel Bug Diagnostic
8. Lock Debugging
9. Tracing the Kernel Flow
10. Kernel Panic, Lockups, and Hangs
11. Using Kernel GDB (KGDB)
12. A Few More Kernel Debugging Approaches

目錄大綱(中文翻譯)

1. 軟體除錯的一般介紹
2. 核心除錯的方法
3. 透過儀器化進行除錯 - printk 和相關工具
4. 透過儀器化進行除錯 - Kprobes
5. 核心記憶體問題的除錯 - 第一部分
6. 核心記憶體問題的除錯 - 第二部分
7. 哎呀!解讀核心錯誤診斷
8. 鎖定除錯
9. 追蹤核心流程
10. 核心恐慌、死結和卡住的除錯
11. 使用核心 GDB (KGDB)
12. 更多核心除錯方法