rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/4] rust: add support for dynamic debug
@ 2025-06-20 21:05 Andrew Ballance
  2025-06-20 21:05 ` [RFC PATCH v2 1/4] rust: jump label: add support for nested arguments Andrew Ballance
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Andrew Ballance @ 2025-06-20 21:05 UTC (permalink / raw)
  To: jbaron, jim.cromie, daniel.almeida, acourbot, ojeda, alex.gaynor,
	boqun.feng, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl,
	tmgross, dakr, gregkh, rafael, rostedt, andrewjballance
  Cc: viresh.kumar, lina+kernel, tamird, jubalh, rust-for-linux,
	linux-kernel

This patch series adds support for dynamic debug to the rust
pr_debug! and dev_dbg! macros.

I have tested it and it and it does work but, there are a few
differences between this and the c version (hence why this is a rfc).

rust does not have an equivalent to the C __func__ macro. so, for the
time being this hard codes the function name to be the name of the
macro e.g. "pr_debug!" and "dev_dbg!".

This uses the module_path! macro to get the module name, which will not
be exactly the same as the c version if a kernel module defines a rust mod.
e.g. it might be "kernel_module_name::rust_module_name".
this does give a more accurate description of where the print statement
is located but it is not identical to what the c version does.

This patch series also had to make a small change to the jump_label module.
to add a STATIC_KEY_INIT_FALSE and updates the static_branch_unlikely
macro so that it allows keys that are nested multiple structs deep
within a static variable.

Closes: https://github.com/Rust-for-Linux/linux/issues/453
Link: https://rust-for-linux.zulipchat.com/#narrow/channel/291565-Help/topic/Dynamic.20Debug.3F/with/519289668

changes in v2:
 - fix typos
 - define and use STATIC_KEY_INIT_FALSE.
 - use raw pointers to avoid undefined behavior
 - use cleaner version of macro definition for nested arguments (thanks Alice)
link to v1: https://lore.kernel.org/rust-for-linux/20250611202952.1670168-1-andrewjballance@gmail.com/

Andrew Ballance (4):
  rust: jump label: add support for nested arguments
  rust: jump label: add STATIC_KEY_INIT_FALSE
  rust: print: add support for dynamic debug to pr_debug!
  rust: device: add support for dynamic debug to dev_dbg!

 rust/bindings/bindings_helper.h |   1 +
 rust/kernel/device.rs           | 105 +++++++++++++++++++-
 rust/kernel/jump_label.rs       |  15 ++-
 rust/kernel/print.rs            | 171 +++++++++++++++++++++++++++++++-
 4 files changed, 281 insertions(+), 11 deletions(-)

-- 
2.49.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH v2 1/4] rust: jump label: add support for nested arguments
  2025-06-20 21:05 [RFC PATCH v2 0/4] rust: add support for dynamic debug Andrew Ballance
@ 2025-06-20 21:05 ` Andrew Ballance
  2025-06-20 21:05 ` [RFC PATCH v2 2/4] rust: jump label: add STATIC_KEY_INIT_FALSE Andrew Ballance
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Ballance @ 2025-06-20 21:05 UTC (permalink / raw)
  To: jbaron, jim.cromie, daniel.almeida, acourbot, ojeda, alex.gaynor,
	boqun.feng, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl,
	tmgross, dakr, gregkh, rafael, rostedt, andrewjballance
  Cc: viresh.kumar, lina+kernel, tamird, jubalh, rust-for-linux,
	linux-kernel

allows for nested arguments to be used with the static_branch macro.
e.g. `outer.inner.key` can now be accessed by the macro

Signed-off-by: Andrew Ballance <andrewjballance@gmail.com>
---
 rust/kernel/jump_label.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rust/kernel/jump_label.rs b/rust/kernel/jump_label.rs
index 4e974c768dbd..002cc3bd73da 100644
--- a/rust/kernel/jump_label.rs
+++ b/rust/kernel/jump_label.rs
@@ -19,9 +19,9 @@
 /// The macro must be used with a real static key defined by C.
 #[macro_export]
 macro_rules! static_branch_unlikely {
-    ($key:path, $keytyp:ty, $field:ident) => {{
+    ($key:path, $keytyp:ty, $($field:ident).+ ) => {{
         let _key: *const $keytyp = ::core::ptr::addr_of!($key);
-        let _key: *const $crate::bindings::static_key_false = ::core::ptr::addr_of!((*_key).$field);
+        let _key: *const $crate::bindings::static_key_false = ::core::ptr::addr_of!((*_key)$(.$field)+);
         let _key: *const $crate::bindings::static_key = _key.cast();
 
         #[cfg(not(CONFIG_JUMP_LABEL))]
@@ -30,7 +30,7 @@ macro_rules! static_branch_unlikely {
         }
 
         #[cfg(CONFIG_JUMP_LABEL)]
-        $crate::jump_label::arch_static_branch! { $key, $keytyp, $field, false }
+        $crate::jump_label::arch_static_branch! { $key, $keytyp, $($field).+, false }
     }};
 }
 pub use static_branch_unlikely;
@@ -46,14 +46,14 @@ macro_rules! static_branch_unlikely {
 #[doc(hidden)]
 #[cfg(CONFIG_JUMP_LABEL)]
 macro_rules! arch_static_branch {
-    ($key:path, $keytyp:ty, $field:ident, $branch:expr) => {'my_label: {
+    ($key:path, $keytyp:ty, $($field:ident).+ , $branch:expr) => {'my_label: {
         $crate::asm!(
             include!(concat!(env!("OBJTREE"), "/rust/kernel/generated_arch_static_branch_asm.rs"));
             l_yes = label {
                 break 'my_label true;
             },
             symb = sym $key,
-            off = const ::core::mem::offset_of!($keytyp, $field),
+            off = const ::core::mem::offset_of!($keytyp, $($field).+),
             branch = const $crate::jump_label::bool_to_int($branch),
         );
 
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC PATCH v2 2/4] rust: jump label: add STATIC_KEY_INIT_FALSE
  2025-06-20 21:05 [RFC PATCH v2 0/4] rust: add support for dynamic debug Andrew Ballance
  2025-06-20 21:05 ` [RFC PATCH v2 1/4] rust: jump label: add support for nested arguments Andrew Ballance
@ 2025-06-20 21:05 ` Andrew Ballance
  2025-06-20 21:05 ` [RFC PATCH v2 3/4] rust: print: add support for dynamic debug to pr_debug! Andrew Ballance
  2025-06-20 21:05 ` [RFC PATCH v2 4/4] rust: device: add support for dynamic debug to dev_dbg! Andrew Ballance
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Ballance @ 2025-06-20 21:05 UTC (permalink / raw)
  To: jbaron, jim.cromie, daniel.almeida, acourbot, ojeda, alex.gaynor,
	boqun.feng, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl,
	tmgross, dakr, gregkh, rafael, rostedt, andrewjballance
  Cc: viresh.kumar, lina+kernel, tamird, jubalh, rust-for-linux,
	linux-kernel

adds a const STATIC_KEY_INIT_FALSE which should be used to init
a static_key_false.

Signed-off-by: Andrew Ballance <andrewjballance@gmail.com>
---
 rust/kernel/jump_label.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/rust/kernel/jump_label.rs b/rust/kernel/jump_label.rs
index 002cc3bd73da..e30db2d06c76 100644
--- a/rust/kernel/jump_label.rs
+++ b/rust/kernel/jump_label.rs
@@ -72,3 +72,8 @@ macro_rules! arch_static_branch {
 pub const fn bool_to_int(b: bool) -> i32 {
     b as i32
 }
+
+/// Default value for a `static_key_false`.
+// SAFETY: a unlikely static key is always zeroed
+#[allow(dead_code)]
+pub(crate) const STATIC_KEY_INIT_FALSE: bindings::static_key_false = unsafe { core::mem::zeroed() };
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC PATCH v2 3/4] rust: print: add support for dynamic debug to pr_debug!
  2025-06-20 21:05 [RFC PATCH v2 0/4] rust: add support for dynamic debug Andrew Ballance
  2025-06-20 21:05 ` [RFC PATCH v2 1/4] rust: jump label: add support for nested arguments Andrew Ballance
  2025-06-20 21:05 ` [RFC PATCH v2 2/4] rust: jump label: add STATIC_KEY_INIT_FALSE Andrew Ballance
@ 2025-06-20 21:05 ` Andrew Ballance
  2025-06-20 21:05 ` [RFC PATCH v2 4/4] rust: device: add support for dynamic debug to dev_dbg! Andrew Ballance
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Ballance @ 2025-06-20 21:05 UTC (permalink / raw)
  To: jbaron, jim.cromie, daniel.almeida, acourbot, ojeda, alex.gaynor,
	boqun.feng, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl,
	tmgross, dakr, gregkh, rafael, rostedt, andrewjballance
  Cc: viresh.kumar, lina+kernel, tamird, jubalh, rust-for-linux,
	linux-kernel

adds support for dynamic debug for the pr_debug macro.

Signed-off-by: Andrew Ballance <andrewjballance@gmail.com>
---
 rust/bindings/bindings_helper.h |   1 +
 rust/kernel/print.rs            | 171 +++++++++++++++++++++++++++++++-
 2 files changed, 168 insertions(+), 4 deletions(-)

diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index bc494745f67b..e05e9ce5d887 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -46,6 +46,7 @@
 #include <linux/cred.h>
 #include <linux/device/faux.h>
 #include <linux/dma-mapping.h>
+#include <linux/dynamic_debug.h>
 #include <linux/errname.h>
 #include <linux/ethtool.h>
 #include <linux/file.h>
diff --git a/rust/kernel/print.rs b/rust/kernel/print.rs
index 9783d960a97a..36573e56a176 100644
--- a/rust/kernel/print.rs
+++ b/rust/kernel/print.rs
@@ -371,13 +371,15 @@ macro_rules! pr_info (
 ///
 /// Use this level for debug messages.
 ///
-/// Equivalent to the kernel's [`pr_debug`] macro, except that it doesn't support dynamic debug
-/// yet.
+/// Equivalent to the kernel's [`pr_debug`] macro.
+///
+/// This has support for [`dynamic debug`].
 ///
 /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and
 /// [`std::format!`] for information about the formatting syntax.
 ///
 /// [`pr_debug`]: https://docs.kernel.org/core-api/printk-basics.html#c.pr_debug
+/// [`dynamic debug`]: https://docs.kernel.org/admin-guide/dynamic-debug-howto.html
 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
 /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html
 ///
@@ -390,8 +392,18 @@ macro_rules! pr_info (
 #[doc(alias = "print")]
 macro_rules! pr_debug (
     ($($arg:tt)*) => (
-        if cfg!(debug_assertions) {
-            $crate::print_macro!($crate::print::format_strings::DEBUG, false, $($arg)*)
+        #[cfg(any(DYNAMIC_DEBUG_MODULE, CONFIG_DYNAMIC_DEBUG))]
+        {
+            if cfg!(debug_assertions) {
+                $crate::dynamic_pr_debug_unlikely!($($arg)*);
+            }
+        }
+
+        #[cfg(not(any(DYNAMIC_DEBUG_MODULE, CONFIG_DYNAMIC_DEBUG)))]
+        {
+            if cfg!(debug_assertions) {
+                $crate::print_macro!($crate::print::format_strings::DEBUG, false, $($arg)*)
+            }
         }
     )
 );
@@ -423,3 +435,154 @@ macro_rules! pr_cont (
         $crate::print_macro!($crate::print::format_strings::CONT, true, $($arg)*)
     )
 );
+
+/// all of the code that is used for dynamic debug for pr_debug!
+/// this is public but hidden. This code should only be called
+/// by the `pr_debug!` or `dev_dbg!` macros.
+#[cfg(CONFIG_DYNAMIC_DEBUG_CORE)]
+#[doc(hidden)]
+pub mod dynamic_debug {
+
+    pub use bindings::_ddebug;
+
+    use crate::c_str;
+    use core::fmt;
+    use kernel::str::CStr;
+
+    /// a wrapper around the C `struct _ddebug`.
+    /// this is public but hidden.
+    ///
+    /// # Invariants
+    ///  - this is always static mut.
+    ///  - this is always located in the "__dyndbg" section.
+    ///  - this has the same layout as `_ddebug`.
+    #[repr(transparent)]
+    pub struct _Ddebug {
+        pub inner: bindings::_ddebug,
+    }
+
+    impl _Ddebug {
+        pub const fn new_unlikely(
+            modname: &'static CStr,
+            function: &'static CStr,
+            filename: &'static CStr,
+            format: &'static CStr,
+            line_num: u32,
+        ) -> Self {
+            // rust does not have support for c like bit fields. so
+            // do some bit fiddling to set the line, class and flags varibles
+            let class: u32 = bindings::_DPRINTK_CLASS_DFLT << 18;
+            let flags: u32 = bindings::_DPRINTK_FLAGS_NONE << 24;
+            let bit_fields: u32 = line_num | class | flags;
+
+            let arr: [u8; 4] = bit_fields.to_ne_bytes();
+            let bits = bindings::__BindgenBitfieldUnit::new(arr);
+
+            #[cfg(CONFIG_JUMP_LABEL)]
+            {
+                Self {
+                    inner: bindings::_ddebug {
+                        modname: modname.as_char_ptr(),
+                        function: function.as_char_ptr(),
+                        filename: filename.as_char_ptr(),
+                        format: format.as_char_ptr(),
+                        _bitfield_align_1: [],
+                        _bitfield_1: bits,
+                        key: kernel::bindings::_ddebug__bindgen_ty_1 {
+                            dd_key_false: kernel::jump_label::STATIC_KEY_INIT_FALSE,
+                        },
+                    },
+                }
+            }
+
+            #[cfg(not(CONFIG_JUMP_LABEL))]
+            {
+                Self {
+                    inner: bindings::_ddebug {
+                        modname: modname.as_char_ptr(),
+                        function: function.as_char_ptr(),
+                        filename: filename.as_char_ptr(),
+                        format: format.as_char_ptr(),
+                        _bitfield_align_1: [],
+                        _bitfield_1: bits,
+                        __bindgen_padding_0: 0,
+                    },
+                }
+            }
+        }
+    }
+
+    /// a wrapper function around the c function `__dynamic_pr_debug`.
+    /// # Safety
+    /// - descriptor must be a valid pointer to a `static mut` _Ddebug
+    pub unsafe fn dynamic_pr_debug(descriptor: *mut _Ddebug, args: fmt::Arguments<'_>) {
+        // SAFETY:
+        // - "%pA" is null terminated and is the format for rust printing
+        // - descriptor.inner is a valid _ddebug
+        unsafe {
+            bindings::__dynamic_pr_debug(
+                &raw mut (*descriptor).inner,
+                c_str!("%pA").as_char_ptr(),
+                (&raw const args).cast::<ffi::c_void>(),
+            );
+        }
+    }
+
+    /// macro for dynamic debug equivalent to the C `pr_debug` macro
+    #[doc(hidden)]
+    #[macro_export]
+    macro_rules! dynamic_pr_debug_unlikely {
+        ($($f:tt)*) => {{
+            use $crate::c_str;
+            use $crate::str::CStr;
+            use $crate::print::dynamic_debug::{_ddebug, _Ddebug};
+
+            const MOD_NAME: &CStr = c_str!(module_path!());
+            // right now rust does not have a function! macro. so, hard code this to be
+            // the name of the macro that is printing
+            // TODO:
+            // replace this once either a function! macro exists
+            // or core::any::type_name becomes const
+            const FN_NAME: &CStr = c_str!("pr_debug!");
+            const FILE_NAME: &CStr = c_str!(file!());
+            const MESSAGE: &CStr = c_str!(stringify!($($f)*));
+            const LINE: u32 = line!();
+
+            #[used]
+            #[unsafe(link_section = "__dyndbg")]
+            static mut DEBUG_INFO: _Ddebug =
+                _Ddebug::new_unlikely(MOD_NAME, FN_NAME, FILE_NAME, MESSAGE, LINE);
+
+            // SAFETY:
+            // - this is reading from a `static mut` variable
+            // - key.dd_key_false is a valid static key
+            let should_print: bool = unsafe {
+                #[cfg(CONFIG_JUMP_LABEL)]
+                {
+                    $crate::jump_label::static_branch_unlikely!(
+                        DEBUG_INFO,
+                        _Ddebug,
+                        inner.key.dd_key_false
+                    )
+                }
+                #[cfg(not(CONFIG_JUMP_LABEL))]
+                {
+                    // gets the _DPRINTK_FLAGS_PRINT bit
+                    // use pointers to avoid undefined behavior
+                    let ptr: *const _ddebug = &raw const DEBUG_INFO.inner;
+                    (*ptr).flags() & 1 != 0
+                }
+            };
+
+            if should_print {
+                // SAFETY: `&raw mut DEBUG_INFO` is a valid pointer to a static mut _Ddebug
+                unsafe {
+                    $crate::print::dynamic_debug::dynamic_pr_debug(
+                        &raw mut DEBUG_INFO,
+                        format_args!($($f)*)
+                    );
+                }
+            }
+        }};
+    }
+}
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC PATCH v2 4/4] rust: device: add support for dynamic debug to dev_dbg!
  2025-06-20 21:05 [RFC PATCH v2 0/4] rust: add support for dynamic debug Andrew Ballance
                   ` (2 preceding siblings ...)
  2025-06-20 21:05 ` [RFC PATCH v2 3/4] rust: print: add support for dynamic debug to pr_debug! Andrew Ballance
@ 2025-06-20 21:05 ` Andrew Ballance
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Ballance @ 2025-06-20 21:05 UTC (permalink / raw)
  To: jbaron, jim.cromie, daniel.almeida, acourbot, ojeda, alex.gaynor,
	boqun.feng, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl,
	tmgross, dakr, gregkh, rafael, rostedt, andrewjballance
  Cc: viresh.kumar, lina+kernel, tamird, jubalh, rust-for-linux,
	linux-kernel

adds support for dynamic debug for the dev_dbg macro.

Signed-off-by: Andrew Ballance <andrewjballance@gmail.com>
---
 rust/kernel/device.rs | 105 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 103 insertions(+), 2 deletions(-)

diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index dea06b79ecb5..829b7ca7bb7b 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -536,11 +536,14 @@ macro_rules! dev_info {
 ///
 /// This level should be used for debug messages.
 ///
-/// Equivalent to the kernel's `dev_dbg` macro, except that it doesn't support dynamic debug yet.
+/// Equivalent to the kernel's `dev_dbg` macro.
+///
+/// This has support for [`dynamic debug`].
 ///
 /// Mimics the interface of [`std::print!`]. More information about the syntax is available from
 /// [`core::fmt`] and [`std::format!`].
 ///
+/// [`dynamic debug`]: https://docs.kernel.org/admin-guide/dynamic-debug-howto.html
 /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html
 /// [`std::format!`]: https://doc.rust-lang.org/std/macro.format.html
 ///
@@ -555,5 +558,103 @@ macro_rules! dev_info {
 /// ```
 #[macro_export]
 macro_rules! dev_dbg {
-    ($($f:tt)*) => { $crate::dev_printk!(pr_dbg, $($f)*); }
+    ($($f:tt)*) => {
+        #[cfg(any(DYNAMIC_DEBUG_MODULE, CONFIG_DYNAMIC_DEBUG))]
+        { $crate::dynamic_dev_dbg_unlikely!($($f)*); }
+
+        #[cfg(not(any(DYNAMIC_DEBUG_MODULE, CONFIG_DYNAMIC_DEBUG)))]
+        { $crate::dev_printk!(pr_dbg, $($f)*); }
+    }
+}
+
+/// this contains all of the code that is used for dynamic debug for dev_dbg!
+/// this is public but hidden. This code should only be called
+/// by the `pr_debug!` or `dev_dbg!` macros.
+#[cfg(CONFIG_DYNAMIC_DEBUG_CORE)]
+#[doc(hidden)]
+pub mod dynamic_debug {
+
+    use super::Device;
+    use kernel::c_str;
+    use kernel::print::dynamic_debug::_Ddebug;
+
+    /// a wrapper function around the c function `__dynamic_dev_dbg`.
+    /// # Safety
+    /// - descriptor must be a valid pointer to a `static mut` _Ddebug
+    pub unsafe fn dynamic_dev_dbg(
+        descriptor: *mut _Ddebug,
+        dev: &Device,
+        args: core::fmt::Arguments<'_>,
+    ) {
+        // SAFETY:
+        // - "%pA" is null terminated and is the format for rust printing
+        // - dev.as_raw() is a valid pointer to struct device
+        unsafe {
+            bindings::__dynamic_dev_dbg(
+                &raw mut (*descriptor).inner,
+                dev.as_raw(),
+                c_str!("%pA").as_char_ptr(),
+                (&raw const args).cast::<ffi::c_void>(),
+            )
+        };
+    }
+
+    /// macro for dynamic debug equivalent to the C `dev_dbg` macro
+    #[doc(hidden)]
+    #[macro_export]
+    macro_rules! dynamic_dev_dbg_unlikely {
+        ($dev:expr, $($f:tt)*) => {{
+            use $crate::c_str;
+            use $crate::str::CStr;
+            use $crate::print::dynamic_debug::{_ddebug, _Ddebug};
+
+            const MOD_NAME: &CStr = c_str!(module_path!());
+            // right now rust does not have a function! macro so hard code this to be
+            // the name of the macro that is printing
+            // TODO:
+            // replace this once either a function! macro exists
+            // or core::any::type_name becomes const
+            const FN_NAME: &CStr = c_str!("dev_dbg!");
+            const FILE_NAME: &CStr = c_str!(file!());
+            const MESSAGE: &CStr = c_str!(stringify!($($f)*));
+            const LINE: u32 = line!();
+
+            #[used]
+            #[unsafe(link_section = "__dyndbg")]
+            static mut DEBUG_INFO: _Ddebug =
+                _Ddebug::new_unlikely(MOD_NAME, FN_NAME, FILE_NAME, MESSAGE, LINE);
+
+            // SAFETY:
+            // - this is reading from a `static mut` variable
+            // - key.dd_key_false is a valid static key
+            let should_print: bool = unsafe {
+                #[cfg(CONFIG_JUMP_LABEL)]
+                {
+                    ::kernel::jump_label::static_branch_unlikely!(
+                        DEBUG_INFO,
+                        _Ddebug,
+                        inner.key.dd_key_false
+                    )
+                }
+                #[cfg(not(CONFIG_JUMP_LABEL))]
+                {
+                    // gets the _DPRINTK_FLAGS_PRINT bit
+                    // use pointers to avoid undefined behavior
+                    let ptr: *const _ddebug = &raw const DEBUG_INFO.inner;
+                    (*ptr).flags() & 1 != 0
+                }
+            };
+
+            if should_print {
+                // SAFETY: `&mut DEBUG_INFO` is a valid pointer to a static mut _Ddebug
+                unsafe {
+                    $crate::device::dynamic_debug::dynamic_dev_dbg(
+                        &raw mut DEBUG_INFO,
+                        $dev,
+                        format_args!($($f)*)
+                    );
+                }
+            }
+        }};
+    }
 }
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-20 21:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 21:05 [RFC PATCH v2 0/4] rust: add support for dynamic debug Andrew Ballance
2025-06-20 21:05 ` [RFC PATCH v2 1/4] rust: jump label: add support for nested arguments Andrew Ballance
2025-06-20 21:05 ` [RFC PATCH v2 2/4] rust: jump label: add STATIC_KEY_INIT_FALSE Andrew Ballance
2025-06-20 21:05 ` [RFC PATCH v2 3/4] rust: print: add support for dynamic debug to pr_debug! Andrew Ballance
2025-06-20 21:05 ` [RFC PATCH v2 4/4] rust: device: add support for dynamic debug to dev_dbg! Andrew Ballance

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).