• A
    perf tools: Output feature detection's gcc output to a file · 443a7054
    Arnaldo Carvalho de Melo 提交于
    So that we can debug feature detection problems.
    
    It will appear on $(OUTPUT)feature-checks/.make-libbabeltrace.output,
    using the libbabeltrace feature test.
    
    Whole process:
    
      [acme@ssdandy linux]$ make -C tools/perf install-bin
      make: Entering directory `/home/acme/git/linux/tools/perf'
        BUILD:   Doing 'make -j8' parallel build
      config/Makefile:425: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
      config/Makefile:709: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
    
      Auto-detecting system features:
      ...                         dwarf: [ on  ]
      ...                         glibc: [ on  ]
      ...                          gtk2: [ on  ]
      ...                      libaudit: [ on  ]
      ...                        libbfd: [ on  ]
      ...                        libelf: [ on  ]
      ...                       libnuma: [ on  ]
      ...                       libperl: [ on  ]
      ...                     libpython: [ on  ]
      ...                      libslang: [ on  ]
      ...                     libunwind: [ OFF ]
      ...            libdw-dwarf-unwind: [ on  ]
      ...                 libbabeltrace: [ OFF ]
      <SNIP>
      [acme@ssdandy linux]$ find tools/perf -name ".make-*.output" | grep lib | tail -5
      tools/perf/config/feature-checks/.make-libdw-dwarf-unwind.output
      tools/perf/config/feature-checks/.make-libbabeltrace.output
      tools/perf/config/feature-checks/.make-zlib.output
      tools/perf/config/feature-checks/.make-liberty.output
      tools/perf/config/feature-checks/.make-liberty-z.output
      [acme@ssdandy linux]$
      [acme@ssdandy linux]$ cat tools/perf/config/feature-checks/.make-libbabeltrace.output
      make[1]: Entering directory `/home/acme/git/linux/tools/perf/config/feature-checks'
      gcc -MD  -Wall -Werror -o test-libbabeltrace.bin test-libbabeltrace.c -Wl,-z,noexecstack  -lbabeltrace-ctf # -lbabeltrace provided by
      test-libbabeltrace.c:2:42: fatal error: babeltrace/ctf-writer/writer.h: No such file or directory
        #include <babeltrace/ctf-writer/writer.h>
                                              ^
      compilation terminated.
      make[1]: *** [test-libbabeltrace.bin] Error 1
      make[1]: Leaving directory `/home/acme/git/linux/tools/perf/config/feature-checks'
      [acme@ssdandy linux]$
    
    So the libbabeltrace feature will not be builtin, but if we do what is required for it
    to be built, namely point where we have it installed:
    
      [acme@ssdandy linux]$ time make -C tools/perf LIBBABELTRACE_DIR=/opt/libbabeltrace install-bin
      make: Entering directory `/home/acme/git/linux/tools/perf'
        BUILD:   Doing 'make -j8' parallel build
      config/Makefile:425: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
    
      Auto-detecting system features:
      ...                         dwarf: [ on  ]
      ...                         glibc: [ on  ]
      ...                          gtk2: [ on  ]
      ...                      libaudit: [ on  ]
      ...                        libbfd: [ on  ]
      ...                        libelf: [ on  ]
      ...                       libnuma: [ on  ]
      ...                       libperl: [ on  ]
      ...                     libpython: [ on  ]
      ...                      libslang: [ on  ]
      ...                     libunwind: [ OFF ]
      ...            libdw-dwarf-unwind: [ on  ]
      ...                 libbabeltrace: [ on  ]
      ...                          zlib: [ on  ]
      ...     DWARF post unwind library: libdw
      <SNIP>
      [acme@ssdandy linux]$ find tools/perf -name ".make-libbabel*.output" | grep lib | tail -5
      tools/perf/config/feature-checks/.make-libbabeltrace.output
      [acme@ssdandy linux]$ cat tools/perf/config/feature-checks/.make-libbabeltrace.output
      make[1]: Entering directory `/home/acme/git/linux/tools/perf/config/feature-checks'
      gcc -MD -I/opt/libbabeltrace/include -Wall -Werror -o test-libbabeltrace.bin test-libbabeltrace.c -Wl,-z,noexecstack -L/opt/libbabeltrace/lib -lbabeltrace-ctf # -lbabeltrace provided by
      make[1]: Leaving directory `/home/acme/git/linux/tools/perf/config/feature-checks'
      [acme@ssdandy linux]$
    Acked-by: NJiri Olsa <jolsa@kernel.org>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Jeremie Galarneau <jgalar@efficios.com>
    Cc: Namhyung Kim <namhyung@gmail.com>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Tom Zanussi <tzanussi@gmail.com>
    Cc: Wang Nan <wangnan0@huawei.com>
    Link: http://lkml.kernel.org/n/tip-h53xwueqwdeeiqcv9f50nqqb@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
    443a7054
Makefile 24.3 KB