Em Tue, Sep 06, 2016 at 09:25:47PM +0800, Wangnan (F) escreveu:
Why? If we want to support older newer kernels running on older distros,
On 2016/9/6 20:59, Arnaldo Carvalho de Melo wrote:
Em Tue, Sep 06, 2016 at 05:48:51AM +0000, Wang Nan escreveu:This is why we have to define these macros for each archs.
tools/perf/trace/beauty/mmap.c, tools/perf/util/event.c andNot "lost on old systems", changing that to "not present on old systems"
tools/perf/util/map.c depend on several macros in mman.h, which
are lost on old systems like ubuntu 12.04. They are architecture
dependened macros. Importing ./arch/*/include/uapi/asm/mman.hok, I'll try keeping the include/uapi/asm-generic/mman.h and
into tools/ is not easy because mman.h for some unusual archs
(like tile) have extra dependencies.
This patch introduces only required macros into mman-fix.h.
Macros list is gotten from tools/perf/trace/beauty/mmap.c.
arch/alpha/include/uapi/asm/mman.h with just what you added, so that at
least the .c files appears as using the headers were those things are
defined in the kernel sources.
Ah, and good eyes in realizing this is not the same value for all
arches!
Your solution in tools/perf/trace/beauty/mmap.c works for
x86 only.
However, I don't like this patchset because we add 300+
lines of code and 22 new files for less than 15 macros,
and only one of them I really concern. Moreover, futhre
code require more symbols in uapi and we have to add new
headers, finally we will clone the whole uapi. We have
to stop doing this...
which is a valid goal, or recent tool source code on older distros,
where fallbacks will take place with their older kernels, and if we have
the build automated for that (I have) then why not keep the tools
building on as many different userspaces as possible?