> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man4/lindebugfs.4.md).

# lindebugfs.4

`lindebugfs` — 用于调试的 Linux 文件系统

## 名称

`lindebugfs`

## 概要

```sh
lindebugfs		/sys/kernel/debug	lindebugfs	rw 0 0
```

## 描述

调试文件系统，或 debugfs，通过在内核和用户空间之间提供简单的数据传输 API，使进程调试更容易。Debugfs 不是通用文件系统，不应用作存储介质。相反，开发人员可在其代码中实现 debugfs 接口，以在运行时生成有关其程序的调试信息。FreeBSD 的 `lindebugfs` 使用 [pseudofs(9)](https://github.com/FreeBSD-Ask/freebsd-man-sc/blob/main/man9/pseudofs.9.md) 文件系统构建工具包，以 Linux 的 debugfs 为模型构建。`lindebugfs` API 旨在与利用 FreeBSD LinuxKPI 兼容层的程序一起使用。

挂载后，`lindebugfs` 将从调用 `debugfs_create_file()` 的任何运行进程填充伪文件。由于 `debugfs_create_file()` 是一个伪文件系统，文件内容将根据程序提供的文件操作动态生成。当前的 `debugfs_create_file()` 实现正式支持 seq\_file 和 simple\_attr\_file 虚拟文件格式。

## 实例

加载 `debugfs_create_file()` 内核模块：

```sh
kldload lindebugfs
```

将 `debugfs_create_file()` 文件系统挂载到 **/sys/kernel/debug**：

```sh
mount -t lindebugfs lindebugfs /sys/kernel/debug
```

## 参见

mount(1), [linprocfs(4)](/man/man4/linprocfs.4.md), [linsysfs(4)](/man/man4/linsysfs.4.md), [linux(4)](/man/man4/linux.4.md), pseudofs(9)

## 历史

`debugfs_create_file()` 文件系统最早出现于 FreeBSD 12.1。

## 作者

`debugfs_create_file()` 的初始实现由 Matthew Macy 创建。本手册页由 Jake Freeland 编写。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man4/lindebugfs.4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
