[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-43104-en":3,"doc-seo-43104-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},43104,2336464648322,"Aria","https://ap-avatar.wpscdn.com/avatar/2200025388227c56fec?_k=1778556882303663488",6,"Technology","Linux Kernel Debugging","Linux Kernel Debugging provides a structured, hands-on approach to diagnosing and fixing issues in the Linux kernel. It covers core debugging concepts, selecting appropriate bug categories, and preparing a reliable workspace with production and debug kernels. The guide demonstrates practical instrumentation methods such as printk, dynamic debug, and early printk, then extends to advanced tracing using kprobes, kretprobes, and eBPF-based observability. Memory-focused chapters address kernel memory defects using KASAN/UBSAN with Clang-based builds.","Linux Kernel Debugging  \nCopyright © 2022 Packt Publishing  \nAll rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.  \nEvery eﬀort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.  \nPackt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.  \nEarly Access Publication: Linux Kernel Debugging  \nEarly Access Production Reference: B17445 Published by Packt Publishing Ltd.  \nLivery Place  \n35 Livery Street Birmingham  \nB3 2PB, UK  \nISBN: 978-1-80107-503-9  \n[www.packt.com](www.packt.com)  \nTable of Contents  \n1. Linux Kernel Debugging  \nI. Linux Kernel Debugging  \n2. 1 A General Introduction to Debugging Software  \nI. Technical requirements  \ni. Cloning this book’s code repository  \nII. Software debugging – what it is, origins, and myths  \nIII. Software bugs – a few actual cases  \ni. Patriot missile failure  \nii. ESA’s unmanned Ariane 5 rocket  \niii. Mars Pathﬁnder reset issue  \niv. The Boeing 737 MAX aircraft – the MCAS and  \nlack of training to the ﬂight crew  \nv. Other cases  \nIV. Setting up the workspace  \ni. Running Linux as a native or guest OS?  \nii. Running Linux as a guest OS  \niii. Installing the Oracle VirtualBox guest additions  \niv. Installing required software packages  \nV. A tale of two kernels  \ni. A production and a debug kernel  \nii. Setting up our custom production kernel  \niii. Setting up our custom debug kernel  \niv. Seeing the diﬀerence – production and debug  \nkernel conﬁg  \nVI. Debugging – a few quick tips  \ni. A programmer’s checklist – seven rules  \nVII. Summary  \nVIII. Further reading  \n3. 2 Approaches to Kernel Debugging  \nI. Technical requirements  \nII. Classifying bug types  \ni. Types of bugs – the classic view  \nii. Types of bugs – the memory view  \niii. Types of bugs – the CVE/CWE security-related view  \niv. Types of bugs – the Linux kernel  \nIII. Kernel debugging – why there are diﬀerent approaches to it  \nIV. Summarizing the diﬀerent approaches to kernel debugging  \ni. Development phase  \nii. Unit testing and/or QA phases  \niii. Categorizing into diﬀerent scenarios  \nV. Summary  \nVI. Further reading  \n4. 3 Debug via Instrumentation – printk and friends  \nI. Technical requirements  \nII. The ubiquitous kernel printk  \ni. Using the printk API’s logging levels  \nii. Leveraging the pr_ \u003Cfoo> convenience macros  \niii. Understanding where the printk output goes  \niv. Practically using the printk format speciﬁers – a few quick tips  \nIII. Leveraging the printk for debug purposes  \ni. Writing debug messages to the kernel log  \nii. Debug printing – quick and useful tips  \niii. Device drivers – use the dev_dbg()  \niv. Trying our kernel module on the custom production kernel  \nv. Rate limiting the printk  \nIV. Using the kernel’s powerful dynamic debug feature  \ni. Dynamic debug via module parameters  \nii. Specifying what and how to print debug messages  \niii. Exercising dynamic debug on a kernel module on a production kernel  \nV. Remaining printk miscellany  \ni. Printing before console init – the early printk  \nii. Designating the printk to some known presets  \niii. Printing exactly once  \niv. Emitting a printk from userspace  \nv. Easily dumping buﬀer content  \nvi. Remaining points – bootloader log peeking, LED ﬂashing and more  \nVI. Summary  \nVII. Further reading  \n5. 4 Debug via Instrumentation ","cbCaidI8l6k7gbHY","https://ap.wps.com/l/cbCaidI8l6k7gbHY","pdf",10168619,3,1,258,"English","en",105,"# Linux Kernel Debugging\n# Approaches to Kernel Debugging\n# Debug via Instrumentation – printk and friends\n# Debug via Instrumentation – Kprobes\n# Debugging Kernel Memory Issues – Part 1\n# Debugging Kernel Memory Issues – Part 2","[{\"question\":\"How does the book recommend setting up a debugging environment for the Linux kernel?\",\"answer\":\"It explains using a production and a dedicated debug kernel configuration, running Linux as native or guest OS, and preparing the workspace with required software packages and VirtualBox guest additions.\"},{\"question\":\"What instrumentation techniques are covered for kernel debugging using printk?\",\"answer\":\"The book covers printk logging levels, convenience macros, where output is sent, format specifiers, writing to the kernel log, device-driver debugging via dev_dbg(), and dynamic debug using module parameters.\"},{\"question\":\"How does the book help detect kernel memory bugs?\",\"answer\":\"It introduces KASAN and UBSAN for finding memory defects, describes kernel configuration for KASAN modes, and includes building kernels and modules with Clang to support memory-checking workflows.\"}]",1783377614,650,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"linux-kernel-debugging","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":20},"https://docshare.wps.com/document/technology/",{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/linux-kernel-debugging/43104/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-15","2026-07-06",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"How does the book recommend setting up a debugging environment for the Linux kernel?","Question",{"text":75,"@type":76},"It explains using a production and a dedicated debug kernel configuration, running Linux as native or guest OS, and preparing the workspace with required software packages and VirtualBox guest additions.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What instrumentation techniques are covered for kernel debugging using printk?",{"text":80,"@type":76},"The book covers printk logging levels, convenience macros, where output is sent, format specifiers, writing to the kernel log, device-driver debugging via dev_dbg(), and dynamic debug using module parameters.",{"name":82,"@type":73,"acceptedAnswer":83},"How does the book help detect kernel memory bugs?",{"text":84,"@type":76},"It introduces KASAN and UBSAN for finding memory defects, describes kernel configuration for KASAN modes, and includes building kernels and modules with Clang to support memory-checking workflows.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,113,118,123,128,131,135],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":111,"slug":112},50,"technology",{"id":114,"doc_module":4,"doc_module_name":46,"category_name":115,"show_sort_weight":116,"slug":117},7,"Healthcare",40,"healthcare",{"id":119,"doc_module":4,"doc_module_name":46,"category_name":120,"show_sort_weight":121,"slug":122},8,"Research & Report",30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]