[DTrace-devel] [PATCH v2 1/2] translators: support 6.10

Nick Alcock nick.alcock at oracle.com
Wed Jun 19 13:15:21 UTC 2024


On 19 Jun 2024, Kris Van Hees stated:

>> -/* #include <linux/buffer_head.h> */
>> +#include <linux/blk_types.h>
>
> This causing a dlib generation failure because this include is not sufficient:
>
> In file included from /home/kvanhees/linux-uek/arch/x86/include/asm/pgtable_types.h:380,
>                  from /home/kvanhees/linux-uek/arch/x86/include/asm/processor.h:21,
>                  from /home/kvanhees/linux-uek/arch/x86/include/asm/cpufeature.h:5,
>                  from /home/kvanhees/linux-uek/arch/x86/include/asm/thread_info.h:59,
>                  from /home/kvanhees/linux-uek/include/linux/thread_info.h:60,
>                  from /home/kvanhees/linux-uek/include/linux/spinlock.h:60,
>                  from /home/kvanhees/linux-uek/include/linux/wait.h:9,
>                  from /home/kvanhees/linux-uek/include/linux/wait_bit.h:8,
>                  from /home/kvanhees/linux-uek/include/linux/fs.h:6,
>                  from /home/kvanhees/linux-uek/include/linux/highmem.h:5,
>                  from /home/kvanhees/linux-uek/include/linux/bvec.h:10,
>                  from /home/kvanhees/linux-uek/include/linux/blk_types.h:10,
>                  from libdtrace/io.m4:14:
> /home/kvanhees/linux-uek/include/asm-generic/pgtable-nopud.h:18: warning: "PUD_SHIFT" redefined
>    18 | #define PUD_SHIFT       P4D_SHIFT

Not observed on 5.4.17, nor on 5.15.0. What kernel is this with?

> The cause seems to be that you should add an include of linux/kconfig.h prior
> to including linux/blk_types.h.  And in all, including linux/buffer_head.h seems
> to be safer because blk_types.h says it shouldn't be included explicitly except
> to break include loops.

Oops, I didn't look at the header comment because it's usually just a
copyright message :)

It works, but at first sight it's not obvious how linux/buffer_head.h
defines BD_PARTNO: I guess it's doing it transitively via some tangle of
other headers. I guess it's always going to include blk_types.h
*somehow*, so I suppose it's safe.

-- 
NULL && (void)



More information about the DTrace-devel mailing list