> For the complete documentation index, see [llms.txt](https://handbook.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://handbook.bsdcn.org/di-28-zhang-dtrace/28.4.-nei-he-wai-bu-mo-kuai.md).

# 28.4.为内核外部模块启用 DTrace

要为内核外部模块添加 DTrace 支持（这对于开发和调试非常有用），在模块的 **Makefile** 中加入以下行：

```sh
CFLAGS+= -DKDTRACE_HOOKS
```

此标志在编译过程中启用 DTrace 钩子，以便对模块做高级调试和监控。修改后请重新编译该模块，以激活 DTrace 功能。
