> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Debugging linux kernel

从高层次来看,您可以将内核空间中的问题分为内核 panic 和 bug 两类。要调试内核空间问题,可以使用下图所示的日志、命令行工具和转储:

<img src="https://mintcdn.com/qualcomm-prod/rpHTx_a6zriKQll9/System/Debug-Subsystem/media/qli-support/Tools-dumps-logs-to-debug-kernelspace.svg?fit=max&auto=format&n=rpHTx_a6zriKQll9&q=85&s=e2abe999678fb74a01400189d3ea23e5" alt="内核空间调试资源的可视化表示,包括用于识别和解决内核级问题的系统日志、命令行选项和内存转储。" width="586" height="287" data-path="System/Debug-Subsystem/media/qli-support/Tools-dumps-logs-to-debug-kernelspace.svg" />

<p align="center">图:调试内核空间问题的资源</p>

* 日志部分包括动态调试、内核调试配置和函数跟踪器
* 命令行工具提供对 `/proc` 和 `debugfs` 文件系统的访问
* 转储部分列出了用于分析系统崩溃和内存状态的 RAM 转储、RAM 解析器和 crash 实用工具

您可以使用 `dmesg` 命令生成内核日志。

要调试内核空间中的问题,建议使用 `debug` 构建。有关如何生成 `debug` 构建的更多信息,请参阅 [Qualcomm Linux 元数据层概述](https://dragonwingdocs.qualcomm.com/Key-Documents/Yocto-Guide/qualcomm-linux-metadata-layers#qualcomm-linux-metadata-layers)。

有关内核源配置文件的更多信息,请参阅 \[Qualcomm Linux 内核指南([https://dragonwingdocs.qualcomm.com/System/Kernel/kernel-overview)。](https://dragonwingdocs.qualcomm.com/System/Kernel/kernel-overview\)。)

有关调试 Linux 内核空间问题的更多信息,请参阅以下章节:

* [启用内核调试](https://dragonwingdocs.qualcomm.com/System/Kernel/configure-kernel-debugger)
* [配置内核以进行调试](https://dragonwingdocs.qualcomm.com/System/Kernel/configure-debug-methods)
* [评估内存使用情况](https://dragonwingdocs.qualcomm.com/System/Debug-Subsystem/assess-memory-usage)
* [跟踪内核函数](https://dragonwingdocs.qualcomm.com/System/Debug-Subsystem/trace-kernel-functions)
* [收集并解析 RAM 转储](https://dragonwingdocs.qualcomm.com/System/Debug-Subsystem/collect-and-parse-ram-dump)
* [使用 RAMParser 解析 RAM 转储](https://dragonwingdocs.qualcomm.com/System/Debug-Subsystem/parse-ram-dumps-using-ram-parser)
* [使用 QCAP 解析 RAM 转储](https://dragonwingdocs.qualcomm.com/System/Debug-Subsystem/parse-ram-dumps-using-qcap)
* [使用 crash 实用工具调试](https://dragonwingdocs.qualcomm.com/System/Debug-Subsystem/debug-using-the-crash-utility-tool)
