aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/task.c
diff options
context:
space:
mode:
authorBoqun Feng <[email protected]>2025-06-15 22:14:00 +0000
committerBoqun Feng <[email protected]>2025-06-24 22:53:46 +0000
commit0aa2b78ce5a9eac8f3332192ea77755d63a831cd (patch)
treedf506edc55b3eb6c2f43564b58f301b23c6f43c1 /rust/helpers/task.c
parentrust: task: Mark Task methods inline (diff)
downloadkernel-0aa2b78ce5a9eac8f3332192ea77755d63a831cd.tar.gz
kernel-0aa2b78ce5a9eac8f3332192ea77755d63a831cd.zip
rust: Introduce file_from_location()
Most of kernel debugging facilities take a nul-terminated string for file names for a callsite (generated from __FILE__), however the Rust courterpart, Location, would return a Rust string (not nul-terminated) from method .file(). And such a string cannot be passed to C debugging function directly. There is ongoing work to support a Location::file_with_nul() [1], which returns a nul-terminated string from a Location. Since it's still working in progress, and it will take some time before the feature finally gets stabilized and the kernel's minimal rustc version might also take a while to bump to a version that at least has that feature, introduce a file_from_location() function, which returns a warning string if Location::file_with_nul() is not available. This should work in most cases because as for now the known usage of Location::file_with_nul() is only in debugging code (e.g. might_sleep()) and there might be other information reported by the debugging code that could help locate the problematic function, so missing the file name is fine at the moment. Link: https://github.com/rust-lang/rust/issues/141727 [1] Signed-off-by: Boqun Feng <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'rust/helpers/task.c')
0 files changed, 0 insertions, 0 deletions