Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1229761

[PATCH 6/8] tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 6/8] tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf
Date 2015-09-21 23:30 +0200
Message-ID <qbgOS-1Me-43@gated-at.bofh.it> (permalink)
References <qbgOR-1Me-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Arnaldo Carvalho de Melo <acme@redhat.com>

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
  $

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: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: pi3orama@163.com
Fixes: 1b76c13e4b36 ("bpf tools: Introduce 'bpf' library and add bpf feature check")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/bpf/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 604c12081b4b..e630f9fc4fb6 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -64,6 +64,7 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
 #$(info Determined 'srctree' to be $(srctree))
 endif
 
+FEATURE_USER = .libbpf
 FEATURE_TESTS = libelf libelf-getphdrnum libelf-mmap bpf
 FEATURE_DISPLAY = libelf bpf
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC 0/8] tools/build fixes related to eBPF support Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-21 23:30 +0200
  [PATCH 6/8] tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-21 23:30 +0200
  [PATCH 8/8] perf tools: Make perf depend on libbpf Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-21 23:30 +0200
    Re: [PATCH 8/8] perf tools: Make perf depend on libbpf Jiri Olsa <jolsa@redhat.com> - 2015-09-22 09:10 +0200
      Re: [PATCH 8/8] perf tools: Make perf depend on libbpf Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-22 15:20 +0200
    Re: [PATCH 8/8] perf tools: Make perf depend on libbpf Jiri Olsa <jolsa@redhat.com> - 2015-09-22 09:10 +0200
      Re: [PATCH 8/8] perf tools: Make perf depend on libbpf Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-22 15:20 +0200
        Re: [PATCH 8/8] perf tools: Make perf depend on libbpf Jiri Olsa <jolsa@redhat.com> - 2015-09-22 15:40 +0200
          Re: [PATCH 8/8] perf tools: Make perf depend on libbpf Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-22 15:50 +0200
          Re: [PATCH 8/8] perf tools: Make perf depend on libbpf Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-22 16:00 +0200

csiph-web