Re: [PATCH 1/3] perf trace: Include copied headers in the beauty directory

From: Namhyung Kim

Date: Mon May 25 2026 - 20:15:09 EST


On Mon, May 25, 2026 at 08:46:18AM -0300, Arnaldo Carvalho de Melo wrote:
> On Sun, May 24, 2026 at 06:11:31PM -0700, Namhyung Kim wrote:
> > We keep uptodate copied of the kernel headers, let's use it directly and
> > don't worry about missing definitions.
>
> Using it directly with the latest header, when reasonable, is indeed
> better than having those conditional defines.
>
> Sometimes it is warranted as having the latest headers may involve
> dragging many files (header dependencies) into the tools/include/ copy
> of kernel headers we try to keep in sync.
>
> > +++ b/tools/perf/trace/beauty/fcntl.c
> > @@ -5,25 +5,10 @@
> > * Copyright (C) 2017, Red Hat Inc, Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> > */
>
> <SNIP>
>
> > -#ifndef F_GET_FILE_RW_HINT
> > -#define F_GET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 13)
> > -#endif
> > +#include "trace/beauty/beauty.h"
> > +#include "trace/beauty/include/uapi/linux/fcntl.h"
>
> The intention isn't documented anywhere, but files in
> trace/beauty/include/uapi were not intended to be used in compiling,
> just scraping, i.e. it didn't need to be compileable, no need to have
> things it includes in turn nor have defines in Makefiles, it would just
> be used by the scripts to extract info from it, info that otherwise
> isn't available as enums (which they should, but that is a digression)
> or as BTF (which would be even better).
>
> Things for compiling would remain in tools/include/, as other tools may
> need them and then the maintainainace of these headers would be shared
> to some degree.
>
> Otherwise each and every tools/ living code that needed copies of header
> files would end up with its own copy, which seems excessive.
>
> What do you think?

Yep, makes sense. I'll try to find a way to use them without including.

Thanks,
Namhyung