Re: [PATCH v6 02/11] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 23, 2021 at 12:41 AM Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
>
> On Mon, Aug 23, 2021 at 1:21 AM Jim Cromie <jim.cromie@xxxxxxxxx> wrote:
> >
> > DEFINE_DYNAMIC_DEBUG_CATEGORIES(name, var, bitmap_desc, @bit_descs)
> > allows users to define a drm.debug style (bitmap) sysfs interface, and
> > to specify the desired mapping from bits[0-N] to the format-prefix'd
> > pr_debug()s to be controlled.
> >

yes to everything, 1 question


> > +       if (!bitmap) {
> > +               pr_err("set_dyndbg: no bits=>queries map\n");
> > +               return -EINVAL;
> > +       }
> > +       rc = kstrtoul(instr, 0, &inbits);
> > +       if (rc) {
> > +               pr_err("set_dyndbg: failed\n");
> > +               return rc;
> > +       }
> > +       vpr_info("set_dyndbg: input 0x%lx\n", inbits);
> > +
> > +       for (i = 0; bitmap->prefix; i++, bitmap++) {
> > +               snprintf(query, FMT_QUERY_SIZE, "format '^%s' %cp", bitmap->prefix,
> > +                        test_bit(i, &inbits) ? '+' : '-');
> > +
> > +               matches = ddebug_exec_queries(query, KP_MOD_NAME);
> > +
> > +               v2pr_info("bit-%d: %d matches on '%s'\n", i, matches, query);
> > +               totct += matches;
> > +       }
>
> I'm wondering if there is a room to parse a bitmap as a bitmap.
>

I dont know what you mean here.
can you point to an example to crib from ?

thanks

> --
> With Best Regards,
> Andy Shevchenko



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux