Re: your recent tools/include/ adjustments

From: Arnaldo Carvalho de Melo
Date: Tue Jan 13 2015 - 08:28:39 EST


Em Tue, Jan 13, 2015 at 08:48:35AM +0000, Jan Beulich escreveu:
> Arnaldo,
>
> considering that tools/include/ gets used by other than just perf, in
> particular arch/x86/vdso/vdso2c.c, would you mind clarifying how
> "tools: Move bitops.h from tools/perf/util to tools/" adding an
> inclusion of asm/hweight.h to linux/bitops.h is supposed to work,
> when the only potentially relevant header to be found is
> tools/perf/util/include/asm/hweight.h?

Oops, includes are tricky, even more so when trying to reuse the kernel
ones in tools/, so we need to go on addressing these problems, thanks
for reporting.

Please take a look if the patch at the end addresses this problem, I
think it should at least disentangle what is in tools/include from what
is in tools/perf/.

I added the bits in the same places as in the matching
include/linux/bitops.h, etc, so that when doing a:

diff -u include/linux/bitops.h tools/include/linux/bitops.h,

For things which we don't completely share with the kernel, the
differences are kept at a minimum.

I think we need to introduce a tools/tests/ to test these kinds of
changes, i.e. introduce simple tests that have in its include path just
what is in tools/include/, to make sure that we don't have it including
things from tools/foo/ tools, like I messed up this time :-/

> Similarly, with "tools: Adopt fls_long and deps" adding 3 stub
> headers to tools/include/asm-generic/bitops/ using
> "#include <../../../../include/asm-generic/bitops/...>", I can't
> see how these headers are to be found when building the above
> mentioned utility - I suppose these really were meant to use
> quotes instead of angle brackets.
>
> For reference, the breakage was observed on a relatively old
> x86 system where linux/elf.h includes asm/elf.h, reaching
> linux/bitops.h via asm/system.h and asm/cpufeature.h.
>
> Thanks for any insight/clarification,

Thanks for the report, I'll try to address this <> issue later today.

- Arnaldo