_2025-03-05_20:47:34_2025-03-05 20:47:34
使用 trace-cmd 追踪内核 _ Linux 中国 - 知乎
原文链接失效了?试试备份
TAGs:操作系统 linux 内核动态追踪
Summary: This article introduces how to use the trace-cmd tool on Linux to trace kernel functions, as an alternative to using ftrace directly. The author explains that using trace-cmd makes the process easier and provides more features. The article covers installing trace-cmd, listing available tracers, starting and stopping function tracing, and adjusting the depth of the trace. The author also demonstrates how to filter the traced functions by name and track kernel modules. An example is given for tracing functions related to the ext4 file system. The article concludes with a brief mention of how to trace a specific PID.本文介绍了如何在 Linux 上使用 trace-cmd 工具来跟踪内核函数,作为直接使用 ftrace 的替代方案。作者解释说,使用 trace-cmd 可以简化该过程并提供更多功能。本文介绍了如何安装 trace-cmd、列出可用的跟踪器、启动和停止函数跟踪以及调整跟踪的深度。作者还演示了如何按名称过滤跟踪的函数并跟踪内核模块。给出了 ext4 文件系统相关的跟踪函数示例。本文最后简要提到了如何跟踪特定 PID。