Skip to content

Linux Kernel Macro to Enum Conversion Wishlist

Omar Sandoval edited this page Oct 21, 2025 · 4 revisions

Background

Macros are not included in debugging symbols by default (GCC and Clang only include them if -g3 is given explicitly, which is rare). Unfortunately, the Linux kernel uses macros for some important constants, which means that debuggers like drgn are not usually able to determine their values. On the other hand, enums are included in debugging symbols.

Wishlist

This is a list of macros in the Linux kernel that would ideally be converted to enums. Feel free to send patches for these upstream and cc [email protected].

Note: beware that the underlying integer type of an enum is implementation-defined, which may be different from the type that the original macro evaluates to. Take care that this does not affect users of the macro. See https://lore.kernel.org/all/[email protected]/ for a relevant discussion.

Done

These are conversions that were previously done which can be used for inspiration.

Clone this wiki locally