Re: [PATCH 20/22] tools arch: Sync arch/x86/lib/memcpy_64.S with the kernel

From: Arnaldo Carvalho de Melo
Date: Tue Apr 25 2017 - 10:13:50 EST


Em Mon, Apr 24, 2017 at 01:36:30PM -0700, Luck, Tony escreveu:
> On Mon, Apr 24, 2017 at 04:54:37PM -0300, Arnaldo Carvalho de Melo wrote:
> > From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

> > Just a minor fix done in:

> > Fixes: 26a37ab319a2 ("x86/mce: Fix copy/paste error in exception table entries")

<SNIP>

> If we are going to have all these copies of kernel files below
> "tools/...", perhaps checkpatch could warn people touching one
> that the other needs the same update?

So, we have tools/perf/check-headers.sh that will warn, when building
tools/perf/, if some of the files we get from the kernel is out of
synch.

When we see this, we should look to see if the change will entail
changes in tools/, if it will drag some other header we don't need, etc.

Sometimes, like in this case, we don't want to pull extra headers, like
asm/export.h, so we have this in that check-headers.sh script:

[acme@jouet linux]$ tail -5 tools/perf/check-headers.sh
# diff with extra ignore lines
check arch/x86/lib/memcpy_64.S -B -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
check arch/x86/lib/memset_64.S -B -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
check include/uapi/asm-generic/mman.h -B -I "^#include <\(uapi/\)*asm-generic/mman-common.h>"
check include/uapi/linux/mman.h -B -I "^#include <\(uapi/\)*asm/mman.h>"
[acme@jouet linux]$

I.e. we want to get as close to what is in the kernel as possible, but
with some exceptions.

And we don't want to add more work to the kernel developers, who can
continue working as if there is no tools/ in the tree.

For those who want to help tools/, then its just a matter of building
perf when doing changes to kernel headers.

We also want these copies because with:

[acme@jouet linux]$ make help | grep perf
perf-tar-src-pkg - Build perf-4.11.0-rc6.tar source tarball
perf-targz-src-pkg - Build perf-4.11.0-rc6.tar.gz source tarball
perf-tarbz2-src-pkg - Build perf-4.11.0-rc6.tar.bz2 source tarball
perf-tarxz-src-pkg - Build perf-4.11.0-rc6.tar.xz source tarball
[acme@jouet linux]$

We can create tarball with just what is needed to build perf, then get
that tarball and move to some other system and build a newer perf to run
in some older environment, older kernel, etc.

- Arnaldo