Add raw trace function

This commit is contained in:
Mark Poliakov 2023-11-14 12:26:40 +02:00
parent ed2cf05838
commit df131ab13b

View File

@ -25,6 +25,16 @@ impl fmt::Write for TracePrinter {
}
}
/// Trace raw message into the kernel's log. If the message is not a valid unicode string, it will
/// get discarded.
pub fn trace_raw(data: &[u8]) {
if let Ok(str) = core::str::from_utf8(data) {
unsafe {
crate::sys::debug_trace(str);
}
}
}
#[doc(hidden)]
pub fn _debug_trace(a: core::fmt::Arguments<'_>) {
use fmt::Write;