Re: [RFC 6/6] perf build: Introduce FEATURES_DUMP make variable

From: Wangnan (F)
Date: Tue Jan 12 2016 - 04:29:29 EST




On 2016/1/11 18:54, Jiri Olsa wrote:
Introducing FEATURES_DUMP make variable to provide features
detection dump file and bypass the feature detection.

The intention is to use this during build tests to skip
repeated features detection, like:

Get feature dump static build into /tmp/fd file:
$ make feature-dump FEATURE_DUMP_COPY=/tmp/fd LDFLAGS=-static
BUILD: Doing 'make -j4' parallel build

Auto-detecting system features:
... dwarf: [ OFF ]

SNIP

FEATURE-DUMP file copied into /tmp/fd

Use /tmp/fd to build perf:
$ make FEATURES_DUMP=/tmp/fd LDFLAGS=-static

$ file perf
perf: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for ...

Suggested-by: Wang Nan <wangnan0@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-fhb47m6t18txuwrzu33is2bo@xxxxxxxxxxxxxx
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
---

Thank you for these two patch. However I found a small limitation.
I must skip 'make clean' between two feature-dump, or the result is wrong.

For example:

$ make feature-dump LDFLAGS="-static"
BUILD: Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>
... zlib: [ on ]
... lzma: [ OFF ] <--- looks good. I don't have static lzma library
... get_cpuid: [ on ]
... bpf: [ on ]


$ make feature-dump
BUILD: Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>
... zlib: [ on ]
... lzma: [ on ] <--- also good
... get_cpuid: [ on ]
... bpf: [ on ]


$ make feature-dump LDFLAGS="-static"
BUILD: Doing 'make -j24' parallel build

Auto-detecting system features:
<SNIP>
... zlib: [ on ]
... lzma: [ on ] <--- Bad...
... get_cpuid: [ on ]
... bpf: [ on ]

Thank you.