seeking guidance on adding MOD_PARAM_BITMAP

jim.cromie at gmail.com jim.cromie at gmail.com
Fri Jul 23 09:33:19 EDT 2021


hi folks,

I would like to add something like the following:

    MOD_PARM_DYNDBG_BITMAP_DESC(__gvt_debug, "dyndbg bitmap desc",
            { "gvt: cmd: ",  "command processing" },
            { "gvt: core: ", "core help" },
            { "gvt: dpy: ",  "display help" },
            { "gvt: el: ",   "help" },
            { "gvt: irq: ",  "help" },
            { "gvt: mm: ",   "help" },
            { "gvt: mmio: ", "help" },
            { "gvt: render: ", "help" },
            { "gvt: sched: " "help" });

the point is to declaratively define an interface, a lot like:

/sys/module/drm/parameters/debug
and
$> modinfo drm
...
parm:           debug:Enable debug output, where each bit enables a
debug category.
Bit 0 (0x01)  will enable CORE messages (drm core code)
Bit 1 (0x02)  will enable DRIVER messages (drm controller code)
Bit 2 (0x04)  will enable KMS messages (modesetting code)
Bit 3 (0x08)  will enable PRIME messages (prime code)
Bit 4 (0x10)  will enable ATOMIC messages (atomic code)
Bit 5 (0x20)  will enable VBL messages (vblank code)
Bit 7 (0x80)  will enable LEASE messages (leasing code)
Bit 8 (0x100) will enable DP messages (displayport code) (int)


is there anything close to this in the kernel that I can copy & modify ?

failing that, what set of macros
(names & files they should be implemented in )
would stand some chance of surviving review ?



More information about the Kernelnewbies mailing list