-
Notifications
You must be signed in to change notification settings - Fork 193
Linux Kernel Macro to Enum Conversion Wishlist
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.
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.
-
MEM_*memory block states: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/memory.h?h=v6.17#n93 -
pageblock_orderand/orpageblock_nr_pages: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/pageblock-flags.h?h=v6.17#n62
These are conversions that were previously done which can be used for inspiration.
- sunrpc
RPC_TASK_*values: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0b108e83795c9c23101f584ef7e3ab4f1f120ef0 -
DCACHE_*flags: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b2b4483b5d05026218127fc8f38c69adf69c235b -
MNT_*flags: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=101f2bbab541116ab861b9c3ac0ece07a7eaa756