# 27.4.启用内核外部模块 DTrace

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

```cpp
CFLAGS+= -DKDTRACE_HOOKS
```

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.bsdcn.org/hanbook/di-27-zhang-dtrace/27.4.-nei-he-wai-bu-mo-kuai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
