You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 7, 2021. It is now read-only.
For instance, %pd will print the path of a struct dentry (by walking its parents), and %pD will print the path of a struct file.
It'd be nice to support those in Rust, probably through impl Display. We should reuse the existing code to format it, somehow.
There's also some unique behavior around printing pointers: %p hashes the pointer before printing it (so equal pointers display equal, but they don't leak kernel memory layout), and %pK will possibly print zero depending on kptr_restrict. You need %px to deliberately print a pointer. I'm not sure how to match that behavior. (I don't think we have any use cases for printing pointers yet, at all....)
The text was updated successfully, but these errors were encountered:
A couple folks asked about this at Plumbers. printk supports format specifiers for various kernel types: https://www.kernel.org/doc/Documentation/printk-formats.txt
For instance,
%pd
will print the path of a struct dentry (by walking its parents), and%pD
will print the path of a struct file.It'd be nice to support those in Rust, probably through
impl Display
. We should reuse the existing code to format it, somehow.There's also some unique behavior around printing pointers:
%p
hashes the pointer before printing it (so equal pointers display equal, but they don't leak kernel memory layout), and%pK
will possibly print zero depending on kptr_restrict. You need%px
to deliberately print a pointer. I'm not sure how to match that behavior. (I don't think we have any use cases for printing pointers yet, at all....)The text was updated successfully, but these errors were encountered: