linux/tools/lib/bpf
Arnaldo Carvalho de Melo 65f041bee7 tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf
When building tools/lib/bpf as part of the tools/perf/ build process,
which will happend when we introduce a patch wiring that up, we end up
stomping on the feature detection caching mechanism, that uses a file in
the output directory (O=) that is shared by libbpf and perf to check if
something changed from one build to another that requires redoing the
feature detection process.

By using the recently introduced FEATURE_USER tools/build/ knob, we can
avoid that:

Before, every make invokation would run the feature detection:

  $ make O=/tmp/build/perf -C tools/perf
  make: Entering directory '/home/git/linux/tools/perf'
  Auto-detecting system features:
  ...                         dwarf: [ on  ]
  ...                         glibc: [ on  ]
  <SNIP>
  ...                     get_cpuid: [ on  ]
  ...                           bpf: [ on  ]

    GEN      perf-archive
    GEN      perf-with-kcore

  Auto-detecting system features:
  ...                        libelf: [ on  ]
  ...                           bpf: [ on  ]
  <SNIP>

After:

  $ make O=/tmp/build/perf -C tools/perf
  make: Entering directory '/home/git/linux/tools/perf'
    BUILD:   Doing 'make -j4' parallel build
  make: Leaving directory '/home/git/linux/tools/perf'
  $

Because we now have two different feature detection state files:

  $ ls -la /tmp/build/perf/FEATURE-DUMP*
  -rw-rw-r--. 1 acme acme 338 Sep 21 17:25 /tmp/build/perf/FEATURE-DUMP
  -rw-rw-r--. 1 acme acme  33 Sep 21 17:25 /tmp/build/perf/FEATURE-DUMP.libbpf
  $

Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: pi3orama@163.com
Fixes: 1b76c13e4b ("bpf tools: Introduce 'bpf' library and add bpf feature check")
Link: http://lkml.kernel.org/n/tip-s6ev9wfqy7pvvs58emys2g90@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-22 10:47:05 -03:00
..
.gitignore bpf tools: Introduce 'bpf' library and add bpf feature check 2015-08-07 10:16:56 -03:00
bpf.c bpf tools: Introduce bpf_load_program() to bpf.c 2015-08-07 10:16:58 -03:00
bpf.h bpf tools: Introduce bpf_load_program() to bpf.c 2015-08-07 10:16:58 -03:00
Build bpf tools: Add bpf.c/h for common bpf operations 2015-08-07 10:16:58 -03:00
libbpf.c bpf tools: New API to get name from a BPF object 2015-08-31 16:53:15 -03:00
libbpf.h bpf tools: New API to get name from a BPF object 2015-08-31 16:53:15 -03:00
Makefile tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf 2015-09-22 10:47:05 -03:00