Documentation/translations/zh_CN/core-api/printk-formats.rst

Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/core-api/printk-formats.rst

File Facts

System
Linux kernel
Corpus path
Documentation/translations/zh_CN/core-api/printk-formats.rst
Extension
.rst
Size
16597 bytes
Lines
598
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct va_format {
		const char *fmt;
		va_list *va;
	};

实现 "递归vsnprintf"。

如果没有一些机制来验证格式字符串和va_list参数的正确性,请不要使用这个功能。

通过引用传递。

设备树节点
----------

::

	%pOF[fnpPcCF]


用于打印设备树节点结构。默认行为相当于%pOFf。

	- f - 设备节点全称
	- n - 设备节点名
	- p - 设备节点句柄
	- P - 设备节点路径规范(名称+@单位)
	- F - 设备节点标志
	- c - 主要兼容字符串
	- C - 全兼容字符串

当使用多个参数时,分隔符是':'。

例如

::

	%pOF	/foo/bar@0			- Node full name
	%pOFf	/foo/bar@0			- Same as above
	%pOFfp	/foo/bar@0:10			- Node full name + phandle
	%pOFfcF	/foo/bar@0:foo,device:--P-	- Node full name +
	                                          major compatible string +
						  node flags
							D - dynamic
							d - detached
							P - Populated
							B - Populated bus

通过引用传递。

Fwnode handles
--------------

::

	%pfw[fP]

用于打印fwnode_handles的消息。默认情况下是打印完整的节点名称,包括路径。
这些修饰符在功能上等同于上面的%pOF。

	- f - 节点的全名,包括路径。
	- P - 节点名称,包括地址(如果有的话)。

例如 (ACPI)

::

	%pfwf	\_SB.PCI0.CIO2.port@1.endpoint@0	- Full node name
	%pfwP	endpoint@0				- Node name

例如 (OF)

Annotation

Implementation Notes