OSDN Git Service

perf tools: Output feature detection's gcc output to a file
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 10 Mar 2015 22:04:31 +0000 (19:04 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 12 Mar 2015 15:39:57 +0000 (12:39 -0300)
commit443a70541c56d4a7dff0ce693870935e138201b2
treea1dda325f15d8543877bea37d93197346003e3f4
parent19a9df35fe9e8ffd60ce4b6f888b72e7c8422d31
perf tools: Output feature detection's gcc output to a file

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: Jiri 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile.perf
tools/perf/config/Makefile