Re: [PATCH v2 1/7] rust_binder: Add dynamic debug logging mask
From: Alice Ryhl
Date: Sun Jul 12 2026 - 04:32:04 EST
On Fri, Jul 10, 2026 at 10:12:35PM +0000, Carlos Llamas wrote:
> On Fri, Jul 10, 2026 at 09:27:37PM +0100, Gary Guo wrote:
> > On Fri Jul 10, 2026 at 8:47 PM BST, Carlos Llamas wrote:
> > > On Fri, Jul 10, 2026 at 02:32:52PM +0000, Jahnavi MN via B4 Relay wrote:
> > >> +kernel::impl_flags!(
> > >> + /// Represents multiple debug mask flags.
> > >> + #[derive(Debug, Clone, Default, Copy, PartialEq, Eq)]
> > >> + pub struct DebugMasks(u32);
> > >
> > > Where is this being used? I can't find it on subsequent patches.
> > > Maybe leftover from previous implementation?
> >
> > impl_flags macro requires a type for a single flag and a type for flag masks.
>
> Oh I see. I was expecting the bitops to be peformed on this type
> somewhere. I guess the reason it wasn't is because of the issue with
> module parameters and their C macros.
I suppose we could implement debug_mask_enabled() like this:
/// Checks if the given debug logging category is enabled in the mask.
pub(crate) fn debug_mask_enabled(mask: DebugMask) -> bool {
let current_mask = unsafe { core::ptr::read_volatile(&raw const rust_binder_debug_mask) };
DebugMasks(current_mask).contains(mask)
}
By wrapping the value from the volatile read (or atomic read) in
DebugMasks, we do actually make use of the DebugMasks type too.
Alice