[PATCH v2] Documentation/printk-formats: Remove notes about %pK
#AppliedFrom:Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date:
Message-ID:<20261019083040.Fgpb8Jz8@linutronix.de>
Patch:v2 · 1/1
Language:zh_CN
Patch-ID:96e37e874cad7a1cc2154478f58bf9b3a8db803a
Files:
Documentation/core-api/printk-formats.rstDocumentation/translations/zh_CN/core-api/printk-formats.rstLinks:lore message ↗ · raw mail ↗
Patch content 2 changed files
The %pK is slowly vanishing from drivers. The %p already prints hashedoutput unless overridden at bootime. It is not obvious for the user whichoutput is using %pK and which does not. Some people pointed out that this documentation encourages people to useit so here is the removal. I also update the translation since the blocklooks the same. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>--- I intend to send the admin-guide/sysctl/kernel.rst bits with the removalfrom vsnprintf itself. I am down to 5 drivers (as of next-20261014).If you think that this documentation should remain as long as theinterface is available then I can postpone this. v1…v2: https://lore.kernel.org/all/20261015133553.kGn_nU-F@linutronix.de/ - Don't remove the whole %p paragraph for the zh_CN translation. Noticed by Andy Shevchenko. Documentation/core-api/printk-formats.rst | 20 ------------------- .../zh_CN/core-api/printk-formats.rst | 15 -------------- 2 files changed, 35 deletions(-) diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rstindex 57e887ff24bc8..9c188d135cc6f 100644--- a/Documentation/core-api/printk-formats.rst+++ b/Documentation/core-api/printk-formats.rst@@ -89,10 +89,6 @@ more information for debugging, use %p and boot the kernel with the addresses unmodified. If you *really* always want the unmodified address, see %px below. -If (and only if) you are printing addresses as a content of a virtual file in-e.g. procfs or sysfs (using e.g. seq_printf(), not printk()) read by a-userspace process, use the %pK modifier described below instead of %p or %px.- Error Pointers -------------- @@ -152,22 +148,6 @@ results in printing a string. For direct use in regular vsnprintf() the (k) and (u) annotation is ignored, however, when used out of BPF's bpf_trace_printk(), for example, it reads the memory it is pointing to without faulting. -Kernel Pointers------------------::-- %pK 01234567 or 0123456789abcdef--For printing kernel pointers which should be hidden from unprivileged-users. The behaviour of %pK depends on the kptr_restrict sysctl - see-Documentation/admin-guide/sysctl/kernel.rst for more details.--This modifier is *only* intended when producing content of a file read by-userspace from e.g. procfs or sysfs, not for dmesg. Please refer to the-section about %p above for discussion about how to manage hashing pointers-in printk().- Unmodified Addresses -------------------- diff --git a/Documentation/translations/zh_CN/core-api/printk-formats.rst b/Documentation/translations/zh_CN/core-api/printk-formats.rstindex 96a917ecc93f2..5922c8ef9b299 100644--- a/Documentation/translations/zh_CN/core-api/printk-formats.rst+++ b/Documentation/translations/zh_CN/core-api/printk-formats.rst@@ -92,11 +92,6 @@ 希地址。如果不可能,而且打印地址的目的是为调试提供更 用 ``no_hash_pointers`` 参数启动内核,这将打印所有未修改的%p地址。如果你 *真的* 想知 道未修改的地址,请看下面的%px。 -如果(也只有在)你将地址作为虚拟文件的内容打印出来,例如在procfs或sysfs中(使用-seq_printf(),而不是printk())由用户空间进程读取,使用下面描述的%pK修饰符,不-要用%p或%px。-- 错误指针 -------- @@ -148,16 +143,6 @@ 来自BPF / tracing追踪的探查指针 定符的结果是打印一个字符串。对于直接在常规的vsnprintf()中使用时,(k)和(u)注释被忽略,但是,当 在BPF的bpf_trace_printk()之外使用时,它会读取它所指向的内存,不会出现错误。 -内核指针-----------::-- %pK 01234567 or 0123456789abcdef--用于打印应该对非特权用户隐藏的内核指针。%pK的行为取决于kptr_restrict sysctl——详见-Documentation/admin-guide/sysctl/kernel.rst。- 未经修改的地址 -------------- -- 2.55.0