* [PATCH 1/8] perf probe: Fix a segfault when removing uprobe events
2015-09-21 21:23 [RFC 0/8] tools/build fixes related to eBPF support Arnaldo Carvalho de Melo
@ 2015-09-21 21:23 ` Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 2/8] perf tools: Don't assume that the parser returns non empty evsel list Arnaldo Carvalho de Melo
` (6 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-21 21:23 UTC (permalink / raw)
To: Jiri Olsa
Cc: Ingo Molnar, linux-kernel, Masami Hiramatsu, Namhyung Kim,
Arnaldo Carvalho de Melo
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Fix a segfault bug and a small mistake in perf probe -d.
Since the "ulist" in perf_del_probe_events is never initialized,
strlist__add(ulist, *) always causes a segfault when removing
uprobe events by perf probe -d.
Also, the "str" local variable is never released if fail to
allocate the "klist". This fixes it too.
This has been introduced by the commit e607f1426b58 ("perf probe:
Print deleted events in cmd_probe()").
Reported-by: Milian Wolff <milian.wolff@kdab.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150916125241.4446.44805.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-probe.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 94385ee89dc8..f7882ae9ebc6 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -380,8 +380,11 @@ static int perf_del_probe_events(struct strfilter *filter)
goto out;
klist = strlist__new(NULL, NULL);
- if (!klist)
- return -ENOMEM;
+ ulist = strlist__new(NULL, NULL);
+ if (!klist || !ulist) {
+ ret = -ENOMEM;
+ goto out;
+ }
ret = probe_file__get_events(kfd, filter, klist);
if (ret == 0) {
--
2.1.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 2/8] perf tools: Don't assume that the parser returns non empty evsel list
2015-09-21 21:23 [RFC 0/8] tools/build fixes related to eBPF support Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 1/8] perf probe: Fix a segfault when removing uprobe events Arnaldo Carvalho de Melo
@ 2015-09-21 21:23 ` Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 3/8] tools build: Fixup feature detection display function name Arnaldo Carvalho de Melo
` (5 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-21 21:23 UTC (permalink / raw)
To: Jiri Olsa
Cc: Ingo Molnar, linux-kernel, Wang Nan, Alexei Starovoitov,
Brendan Gregg, Daniel Borkmann, David Ahern, He Kuang, Kaixu Xia,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
Don't blindly retrieve and use a last element in the lists returned by
parse_events__scanner(), as it may have collected no entries, i.e.
return an empty list.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kaixu Xia <xiakaixu@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1441523623-152703-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/parse-events.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 0fde5293a38e..61c2bc20926d 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -827,6 +827,11 @@ void parse_events__set_leader(char *name, struct list_head *list)
{
struct perf_evsel *leader;
+ if (list_empty(list)) {
+ WARN_ONCE(true, "WARNING: failed to set leader: empty list");
+ return;
+ }
+
__perf_evlist__set_leader(list);
leader = list_entry(list->next, struct perf_evsel, node);
leader->group_name = name ? strdup(name) : NULL;
@@ -1176,6 +1181,11 @@ int parse_events(struct perf_evlist *evlist, const char *str,
if (!ret) {
struct perf_evsel *last;
+ if (list_empty(&data.list)) {
+ WARN_ONCE(true, "WARNING: event parser found nothing");
+ return -1;
+ }
+
perf_evlist__splice_list_tail(evlist, &data.list);
evlist->nr_groups += data.nr_groups;
last = perf_evlist__last(evlist);
@@ -1285,6 +1295,12 @@ foreach_evsel_in_last_glob(struct perf_evlist *evlist,
struct perf_evsel *last = NULL;
int err;
+ /*
+ * Don't return when list_empty, give func a chance to report
+ * error when it found last == NULL.
+ *
+ * So no need to WARN here, let *func do this.
+ */
if (evlist->nr_entries > 0)
last = perf_evlist__last(evlist);
--
2.1.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 3/8] tools build: Fixup feature detection display function name
2015-09-21 21:23 [RFC 0/8] tools/build fixes related to eBPF support Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 1/8] perf probe: Fix a segfault when removing uprobe events Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 2/8] perf tools: Don't assume that the parser returns non empty evsel list Arnaldo Carvalho de Melo
@ 2015-09-21 21:23 ` Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 4/8] tools lib ebpf: Fix up FEATURE_{TESTS,DISPLAY} usage Arnaldo Carvalho de Melo
` (4 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-21 21:23 UTC (permalink / raw)
To: Jiri Olsa
Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
Adrian Hunter, Alexei Starovoitov, Borislav Petkov, David Ahern,
Frederic Weisbecker, Namhyung Kim, Stephane Eranian, Wang Nan,
pi3orama
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Cut'n'paste mistake, it should eval the name of the function
defined right next to it, in the next line, fix it.
Before:
$ make -C tools/lib/bpf/
make: Entering directory '/home/git/linux/tools/lib/bpf'
Auto-detecting system features:
... libelf: [ on ]
... libelf-getphdrnum: [ on ]
... libelf-mmap: [ on ]
... bpf: [ on ]
<SNIP>
After:
$ make -C tools/lib/bpf/
make: Entering directory '/home/git/linux/tools/lib/bpf'
Auto-detecting system features:
... libelf: [ on ]
... libelf-getphdrnum: [ OFF ]
... libelf-mmap: [ OFF ]
... bpf: [ on ]
<SNIP>
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: 58d4f00ff13f ("perf build: Fix feature_check name clash")
Link: http://lkml.kernel.org/n/tip-dzu1c4sruukgfq5d5b1c4r30@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/Makefile.feature | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index c8fe6d177119..690d5614edd4 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -140,7 +140,7 @@ ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
feature_display := 1
endif
-feature_display_check = $(eval $(feature_check_code))
+feature_display_check = $(eval $(feature_check_display_code))
define feature_display_check_code
ifneq ($(feature-$(1)), 1)
feature_display := 1
--
2.1.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 4/8] tools lib ebpf: Fix up FEATURE_{TESTS,DISPLAY} usage
2015-09-21 21:23 [RFC 0/8] tools/build fixes related to eBPF support Arnaldo Carvalho de Melo
` (2 preceding siblings ...)
2015-09-21 21:23 ` [PATCH 3/8] tools build: Fixup feature detection display function name Arnaldo Carvalho de Melo
@ 2015-09-21 21:23 ` Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 5/8] tools build: Allow setting the feature detection user Arnaldo Carvalho de Melo
` (3 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-21 21:23 UTC (permalink / raw)
To: Jiri Olsa
Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
Adrian Hunter, Alexei Starovoitov, Borislav Petkov, David Ahern,
Frederic Weisbecker, Namhyung Kim, Stephane Eranian, Wang Nan,
pi3orama
From: Arnaldo Carvalho de Melo <acme@redhat.com>
When libbpf was introduced it wrongly asked for the "libelf" and "bpf"
feature tests to be performed (via FEATURE_TESTS), while asking that
"libbpf", "libelf-mmap", "libelf-getphdrnum" and "bpf" to have the
result of its respective tests to be displayed (via FEATURE_DISPLAY).
Due to another recently bug fixed in the tools/build/ infrastructure
("tools build: Fixup feature detection display function name") the
results for the entries in the FEATURE_DISPLAY, for this case, were
appearing as all succeeding, when two of them (the ones only on the
DISPLAY) were not even being performed.
Before:
$ make -C tools/lib/bpf/
make: Entering directory '/home/git/linux/tools/lib/bpf'
Auto-detecting system features:
... libelf: [ on ]
... libelf-getphdrnum: [ OFF ]
... libelf-mmap: [ OFF ]
... bpf: [ on ]
<SNIP>
After, with FEATURE_TESTS == FEATURE_DISPLAY:
Auto-detecting system features:
... libelf: [ on ]
... libelf-getphdrnum: [ on ]
... libelf-mmap: [ on ]
... bpf: [ on ]
<SNIP>
I just inverted, so that it tests the four features but displays just
the libelf and mmap ones, to make it more compact. So it becomes:
$ make -C tools/lib/bpf/
make: Entering directory '/home/git/linux/tools/lib/bpf'
Auto-detecting system features:
... libelf: [ on ]
... bpf: [ on ]
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")
Link: http://lkml.kernel.org/n/tip-y4bd59e6j9rzzojiyeqrg2jq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/bpf/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index f68d23a0b487..604c12081b4b 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -64,8 +64,8 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif
-FEATURE_DISPLAY = libelf libelf-getphdrnum libelf-mmap bpf
-FEATURE_TESTS = libelf bpf
+FEATURE_TESTS = libelf libelf-getphdrnum libelf-mmap bpf
+FEATURE_DISPLAY = libelf bpf
INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)
--
2.1.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 5/8] tools build: Allow setting the feature detection user
2015-09-21 21:23 [RFC 0/8] tools/build fixes related to eBPF support Arnaldo Carvalho de Melo
` (3 preceding siblings ...)
2015-09-21 21:23 ` [PATCH 4/8] tools lib ebpf: Fix up FEATURE_{TESTS,DISPLAY} usage Arnaldo Carvalho de Melo
@ 2015-09-21 21:23 ` Arnaldo Carvalho de Melo
2015-09-22 6:51 ` Jiri Olsa
2015-09-21 21:23 ` [PATCH 6/8] tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf Arnaldo Carvalho de Melo
` (2 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-21 21:23 UTC (permalink / raw)
To: Jiri Olsa
Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
Alexei Starovoitov, Adrian Hunter, Borislav Petkov, David Ahern,
Frederic Weisbecker, Namhyung Kim, Stephane Eranian, Wang Nan,
pi3orama
From: Arnaldo Carvalho de Melo <acme@redhat.com>
We will use the tools/build/ autodetection in the eBPF patchkit
and it is currently sharing the output directory with perf, that
also uses the feature detection logic.
As se keep state in the output directory, so that we can avoid running
all the tests again, we need to have different filenames for the files
used in this state, allow doing that via the FEATURE_USER variable,
to be set alongside the existing FEATURE_{TEST,DISPLAY} variables.
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Adrian Hunter <adrian.hunter@intel.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
Link: http://lkml.kernel.org/n/tip-qzkc56xurvxwppvc1p0qdw3t@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/Makefile.feature | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 690d5614edd4..5365d0fefadb 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -121,8 +121,9 @@ define feature_print_text_code
MSG = $(shell printf '...%30s: %s' $(1) $(2))
endef
+FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER)
FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat))))
-FEATURE_DUMP_FILE := $(shell touch $(OUTPUT)FEATURE-DUMP; cat $(OUTPUT)FEATURE-DUMP)
+FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME))
ifeq ($(dwarf-post-unwind),1)
FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
@@ -136,7 +137,7 @@ endif
# - VF is enabled
ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
- $(shell echo "$(FEATURE_DUMP)" > $(OUTPUT)FEATURE-DUMP)
+ $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
feature_display := 1
endif
--
2.1.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 5/8] tools build: Allow setting the feature detection user
2015-09-21 21:23 ` [PATCH 5/8] tools build: Allow setting the feature detection user Arnaldo Carvalho de Melo
@ 2015-09-22 6:51 ` Jiri Olsa
2015-09-22 13:02 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 19+ messages in thread
From: Jiri Olsa @ 2015-09-22 6:51 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
Alexei Starovoitov, Adrian Hunter, Borislav Petkov, David Ahern,
Frederic Weisbecker, Namhyung Kim, Stephane Eranian, Wang Nan,
pi3orama
On Mon, Sep 21, 2015 at 06:23:18PM -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> We will use the tools/build/ autodetection in the eBPF patchkit
> and it is currently sharing the output directory with perf, that
> also uses the feature detection logic.
>
> As se keep state in the output directory, so that we can avoid running
> all the tests again, we need to have different filenames for the files
> used in this state, allow doing that via the FEATURE_USER variable,
> to be set alongside the existing FEATURE_{TEST,DISPLAY} variables.
>
> Acked-by: Jiri Olsa <jolsa@kernel.org>
> Cc: Alexei Starovoitov <ast@plumgrid.com>
> Cc: Adrian Hunter <adrian.hunter@intel.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
> Link: http://lkml.kernel.org/n/tip-qzkc56xurvxwppvc1p0qdw3t@git.kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> tools/build/Makefile.feature | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 690d5614edd4..5365d0fefadb 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -121,8 +121,9 @@ define feature_print_text_code
> MSG = $(shell printf '...%30s: %s' $(1) $(2))
> endef
>
> +FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER)
> FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat))))
> -FEATURE_DUMP_FILE := $(shell touch $(OUTPUT)FEATURE-DUMP; cat $(OUTPUT)FEATURE-DUMP)
> +FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME))
>
> ifeq ($(dwarf-post-unwind),1)
> FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
> @@ -136,7 +137,7 @@ endif
> # - VF is enabled
>
> ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
> - $(shell echo "$(FEATURE_DUMP)" > $(OUTPUT)FEATURE-DUMP)
> + $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
> feature_display := 1
> endif
one nit ;-)
jirka
---
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 5365d0fefadb..b37101207cbd 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -132,7 +132,7 @@ endif
# The $(feature_display) controls the default detection message
# output. It's set if:
# - detected features differes from stored features from
-# last build (in FEATURE-DUMP file)
+# last build (in FEATURE-DUMP$(FEATURE_USER) file)
# - one of the $(FEATURE_DISPLAY) is not detected
# - VF is enabled
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 5/8] tools build: Allow setting the feature detection user
2015-09-22 6:51 ` Jiri Olsa
@ 2015-09-22 13:02 ` Arnaldo Carvalho de Melo
2015-09-22 13:05 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-22 13:02 UTC (permalink / raw)
To: Jiri Olsa
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Alexei Starovoitov,
Adrian Hunter, Borislav Petkov, David Ahern, Frederic Weisbecker,
Namhyung Kim, Stephane Eranian, Wang Nan, pi3orama
Em Tue, Sep 22, 2015 at 08:51:00AM +0200, Jiri Olsa escreveu:
> On Mon, Sep 21, 2015 at 06:23:18PM -0300, Arnaldo Carvalho de Melo wrote:
> > From: Arnaldo Carvalho de Melo <acme@redhat.com>
> >
> > We will use the tools/build/ autodetection in the eBPF patchkit
> > and it is currently sharing the output directory with perf, that
> > also uses the feature detection logic.
> >
> > As se keep state in the output directory, so that we can avoid running
> > all the tests again, we need to have different filenames for the files
> > used in this state, allow doing that via the FEATURE_USER variable,
> > to be set alongside the existing FEATURE_{TEST,DISPLAY} variables.
> >
> > Acked-by: Jiri Olsa <jolsa@kernel.org>
> > Cc: Alexei Starovoitov <ast@plumgrid.com>
> > Cc: Adrian Hunter <adrian.hunter@intel.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
> > Link: http://lkml.kernel.org/n/tip-qzkc56xurvxwppvc1p0qdw3t@git.kernel.org
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > ---
> > tools/build/Makefile.feature | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> > index 690d5614edd4..5365d0fefadb 100644
> > --- a/tools/build/Makefile.feature
> > +++ b/tools/build/Makefile.feature
> > @@ -121,8 +121,9 @@ define feature_print_text_code
> > MSG = $(shell printf '...%30s: %s' $(1) $(2))
> > endef
> >
> > +FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER)
> > FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat))))
> > -FEATURE_DUMP_FILE := $(shell touch $(OUTPUT)FEATURE-DUMP; cat $(OUTPUT)FEATURE-DUMP)
> > +FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME))
> >
> > ifeq ($(dwarf-post-unwind),1)
> > FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
> > @@ -136,7 +137,7 @@ endif
> > # - VF is enabled
> >
> > ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
> > - $(shell echo "$(FEATURE_DUMP)" > $(OUTPUT)FEATURE-DUMP)
> > + $(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
> > feature_display := 1
> > endif
>
> one nit ;-)
Good, at first I thought the mistake was more embarassing, like
forgetting one real use of that file... Fixing it, thanks!
- Arnaldo
> jirka
>
>
> ---
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 5365d0fefadb..b37101207cbd 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -132,7 +132,7 @@ endif
> # The $(feature_display) controls the default detection message
> # output. It's set if:
> # - detected features differes from stored features from
> -# last build (in FEATURE-DUMP file)
> +# last build (in FEATURE-DUMP$(FEATURE_USER) file)
> # - one of the $(FEATURE_DISPLAY) is not detected
> # - VF is enabled
>
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 5/8] tools build: Allow setting the feature detection user
2015-09-22 13:02 ` Arnaldo Carvalho de Melo
@ 2015-09-22 13:05 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-22 13:05 UTC (permalink / raw)
To: Jiri Olsa
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Alexei Starovoitov,
Adrian Hunter, Borislav Petkov, David Ahern, Frederic Weisbecker,
Namhyung Kim, Stephane Eranian, Wang Nan, pi3orama
Em Tue, Sep 22, 2015 at 10:02:42AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Sep 22, 2015 at 08:51:00AM +0200, Jiri Olsa escreveu:
> > On Mon, Sep 21, 2015 at 06:23:18PM -0300, Arnaldo Carvalho de Melo wrote:
> > one nit ;-)
>
> Good, at first I thought the mistake was more embarassing, like
> forgetting one real use of that file... Fixing it, thanks!
> > +++ b/tools/build/Makefile.feature
> > @@ -132,7 +132,7 @@ endif
> > # The $(feature_display) controls the default detection message
> > # output. It's set if:
> > # - detected features differes from stored features from
> > -# last build (in FEATURE-DUMP file)
> > +# last build (in FEATURE-DUMP$(FEATURE_USER) file)
> > # - one of the $(FEATURE_DISPLAY) is not detected
I changed it to:
# The $(feature_display) controls the default detection message
# output. It's set if:
# - detected features differes from stored features from
-# last build (in FEATURE-DUMP file)
+# last build (in $(FEATURE_DUMP_FILENAME) file)
# - one of the $(FEATURE_DISPLAY) is not detected
So that we take $(OUTPUT) into account as well :-)
- Arnaldo
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 6/8] tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf
2015-09-21 21:23 [RFC 0/8] tools/build fixes related to eBPF support Arnaldo Carvalho de Melo
` (4 preceding siblings ...)
2015-09-21 21:23 ` [PATCH 5/8] tools build: Allow setting the feature detection user Arnaldo Carvalho de Melo
@ 2015-09-21 21:23 ` Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 7/8] perf tools: Add include/err.h into MANIFEST Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 8/8] perf tools: Make perf depend on libbpf Arnaldo Carvalho de Melo
7 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-21 21:23 UTC (permalink / raw)
To: Jiri Olsa
Cc: Ingo Molnar, linux-kernel, Arnaldo Carvalho de Melo,
Adrian Hunter, Alexei Starovoitov, Borislav Petkov, David Ahern,
Frederic Weisbecker, Namhyung Kim, Stephane Eranian, Wang Nan,
pi3orama
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
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 7/8] perf tools: Add include/err.h into MANIFEST
2015-09-21 21:23 [RFC 0/8] tools/build fixes related to eBPF support Arnaldo Carvalho de Melo
` (5 preceding siblings ...)
2015-09-21 21:23 ` [PATCH 6/8] tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf Arnaldo Carvalho de Melo
@ 2015-09-21 21:23 ` Arnaldo Carvalho de Melo
2015-09-21 21:23 ` [PATCH 8/8] perf tools: Make perf depend on libbpf Arnaldo Carvalho de Melo
7 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-21 21:23 UTC (permalink / raw)
To: Jiri Olsa
Cc: Ingo Molnar, linux-kernel, David Ahern, Namhyung Kim,
Peter Zijlstra, Arnaldo Carvalho de Melo
From: Jiri Olsa <jolsa@kernel.org>
Otherwise the tarpkg is incomplete (tarpkg tests fails).
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixes: 01ca9fd41d6f ("tools: Add err.h with ERR_PTR PTR_ERR interface")
Link: http://lkml.kernel.org/r/1442846143-8556-1-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/MANIFEST | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
index 2a958a80c763..9e6bdf5b2df6 100644
--- a/tools/perf/MANIFEST
+++ b/tools/perf/MANIFEST
@@ -50,6 +50,7 @@ tools/include/linux/poison.h
tools/include/linux/rbtree.h
tools/include/linux/rbtree_augmented.h
tools/include/linux/types.h
+tools/include/linux/err.h
include/asm-generic/bitops/arch_hweight.h
include/asm-generic/bitops/const_hweight.h
include/asm-generic/bitops/fls64.h
--
2.1.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH 8/8] perf tools: Make perf depend on libbpf
2015-09-21 21:23 [RFC 0/8] tools/build fixes related to eBPF support Arnaldo Carvalho de Melo
` (6 preceding siblings ...)
2015-09-21 21:23 ` [PATCH 7/8] perf tools: Add include/err.h into MANIFEST Arnaldo Carvalho de Melo
@ 2015-09-21 21:23 ` Arnaldo Carvalho de Melo
2015-09-22 7:02 ` Jiri Olsa
2015-09-22 7:03 ` Jiri Olsa
7 siblings, 2 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-21 21:23 UTC (permalink / raw)
To: Jiri Olsa
Cc: Ingo Molnar, linux-kernel, Wang Nan, Brendan Gregg,
Daniel Borkmann, David Ahern, He Kuang, Kaixu Xia,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Zefan Li, pi3orama, Arnaldo Carvalho de Melo
From: Wang Nan <wangnan0@huawei.com>
By adding libbpf into perf's Makefile, this patch enables perf to build
libbpf during building if libelf is found and neither NO_LIBELF nor
NO_LIBBPF is set. The newly introduced code is similar to libapi and
libtraceevent building in Makefile.perf.
MANIFEST is also updated for 'make perf-*-src-pkg'.
Append make_no_libbpf to tools/perf/tests/make.
'bpf' feature check is appended into default FEATURE_TESTS and
FEATURE_DISPLAY, so perf will check API version of bpf in
/path/to/kernel/include/uapi/linux/bpf.h. Which should not fail except
when we are trying to port this code to an old kernel.
Error messages are also updated to notify users about the disable of BPF
support of 'perf record' if libelf is missed or BPF API check failed.
tools/lib/bpf is added into TAG_FOLDERS to allow us to navigate on
libbpf files when working on perf using tools/perf/tags.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kaixu Xia <xiakaixu@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1441523623-152703-3-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/Makefile.feature | 6 ++++--
tools/perf/MANIFEST | 3 +++
tools/perf/Makefile.perf | 19 +++++++++++++++++--
tools/perf/config/Makefile | 19 ++++++++++++++++++-
tools/perf/tests/make | 4 +++-
5 files changed, 45 insertions(+), 6 deletions(-)
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 5365d0fefadb..0dedb3d245a1 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -53,7 +53,8 @@ FEATURE_TESTS ?= \
libdw-dwarf-unwind \
zlib \
lzma \
- get_cpuid
+ get_cpuid \
+ bpf
FEATURE_DISPLAY ?= \
dwarf \
@@ -71,7 +72,8 @@ FEATURE_DISPLAY ?= \
libdw-dwarf-unwind \
zlib \
lzma \
- get_cpuid
+ get_cpuid \
+ bpf
# Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
# If in the future we need per-feature checks/flags for features not
diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
index 9e6bdf5b2df6..39c38cb45b00 100644
--- a/tools/perf/MANIFEST
+++ b/tools/perf/MANIFEST
@@ -17,6 +17,7 @@ tools/build
tools/arch/x86/include/asm/atomic.h
tools/arch/x86/include/asm/rmwcc.h
tools/lib/traceevent
+tools/lib/bpf
tools/lib/api
tools/lib/bpf
tools/lib/hweight.c
@@ -69,6 +70,8 @@ arch/*/lib/memset*.S
include/linux/poison.h
include/linux/hw_breakpoint.h
include/uapi/linux/perf_event.h
+include/uapi/linux/bpf.h
+include/uapi/linux/bpf_common.h
include/uapi/linux/const.h
include/uapi/linux/swab.h
include/uapi/linux/hw_breakpoint.h
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 6c5c699002cb..8af786f458df 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -145,6 +145,7 @@ AWK = awk
LIB_DIR = $(srctree)/tools/lib/api/
TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
+BPF_DIR = $(srctree)/tools/lib/bpf/
# include config/Makefile by default and rule out
# non-config cases
@@ -180,6 +181,7 @@ strip-libs = $(filter-out -l%,$(1))
ifneq ($(OUTPUT),)
TE_PATH=$(OUTPUT)
+ BPF_PATH=$(OUTPUT)
ifneq ($(subdir),)
LIB_PATH=$(OUTPUT)/../lib/api/
else
@@ -188,6 +190,7 @@ endif
else
TE_PATH=$(TRACE_EVENT_DIR)
LIB_PATH=$(LIB_DIR)
+ BPF_PATH=$(BPF_DIR)
endif
LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -199,6 +202,8 @@ LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS = -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYN
LIBAPI = $(LIB_PATH)libapi.a
export LIBAPI
+LIBBPF = $(BPF_PATH)libbpf.a
+
# python extension build directories
PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
@@ -251,6 +256,9 @@ export PERL_PATH
LIB_FILE=$(OUTPUT)libperf.a
PERFLIBS = $(LIB_FILE) $(LIBAPI) $(LIBTRACEEVENT)
+ifndef NO_LIBBPF
+ PERFLIBS += $(LIBBPF)
+endif
# We choose to avoid "if .. else if .. else .. endif endif"
# because maintaining the nesting to match is a pain. If
@@ -420,6 +428,13 @@ $(LIBAPI)-clean:
$(call QUIET_CLEAN, libapi)
$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
+$(LIBBPF): FORCE
+ $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a
+
+$(LIBBPF)-clean:
+ $(call QUIET_CLEAN, libbpf)
+ $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null
+
help:
@echo 'Perf make targets:'
@echo ' doc - make *all* documentation (see below)'
@@ -459,7 +474,7 @@ INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
$(DOC_TARGETS):
$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
-TAG_FOLDERS= . ../lib/traceevent ../lib/api ../lib/symbol ../include
+TAG_FOLDERS= . ../lib/traceevent ../lib/api ../lib/symbol ../include ../lib/bpf
TAG_FILES= ../../include/uapi/linux/perf_event.h
TAGS:
@@ -567,7 +582,7 @@ config-clean:
$(call QUIET_CLEAN, config)
$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
-clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean config-clean
+clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean config-clean
$(call QUIET_CLEAN, core-objs) $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
$(Q)$(RM) $(OUTPUT).config-detected
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index ab09adaabc9c..de89ec574361 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -106,6 +106,7 @@ ifdef LIBBABELTRACE
FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
endif
+FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
# include ARCH specific config
-include $(src-perf)/arch/$(ARCH)/Makefile
@@ -237,6 +238,7 @@ ifdef NO_LIBELF
NO_DEMANGLE := 1
NO_LIBUNWIND := 1
NO_LIBDW_DWARF_UNWIND := 1
+ NO_LIBBPF := 1
else
ifeq ($(feature-libelf), 0)
ifeq ($(feature-glibc), 1)
@@ -246,13 +248,14 @@ else
LIBC_SUPPORT := 1
endif
ifeq ($(LIBC_SUPPORT),1)
- msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
+ msg := $(warning No libelf found, disables 'probe' tool and BPF support in 'perf record', please install elfutils-libelf-devel/libelf-dev);
NO_LIBELF := 1
NO_DWARF := 1
NO_DEMANGLE := 1
NO_LIBUNWIND := 1
NO_LIBDW_DWARF_UNWIND := 1
+ NO_LIBBPF := 1
else
ifneq ($(filter s% -static%,$(LDFLAGS),),)
msg := $(error No static glibc found, please install glibc-static);
@@ -309,6 +312,13 @@ ifndef NO_LIBELF
$(call detected,CONFIG_DWARF)
endif # PERF_HAVE_DWARF_REGS
endif # NO_DWARF
+
+ ifndef NO_LIBBPF
+ ifeq ($(feature-bpf), 1)
+ CFLAGS += -DHAVE_LIBBPF_SUPPORT
+ $(call detected,CONFIG_LIBBPF)
+ endif
+ endif # NO_LIBBPF
endif # NO_LIBELF
ifeq ($(ARCH),powerpc)
@@ -324,6 +334,13 @@ ifndef NO_LIBUNWIND
endif
endif
+ifndef NO_LIBBPF
+ ifneq ($(feature-bpf), 1)
+ msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
+ NO_LIBBPF := 1
+ endif
+endif
+
dwarf-post-unwind := 1
dwarf-post-unwind-text := BUG
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index ba31c4bd441d..2cbd0c6901e3 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -44,6 +44,7 @@ make_no_libnuma := NO_LIBNUMA=1
make_no_libaudit := NO_LIBAUDIT=1
make_no_libbionic := NO_LIBBIONIC=1
make_no_auxtrace := NO_AUXTRACE=1
+make_no_libbpf := NO_LIBBPF=1
make_tags := tags
make_cscope := cscope
make_help := help
@@ -66,7 +67,7 @@ make_static := LDFLAGS=-static
make_minimal := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
make_minimal += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
-make_minimal += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1
+make_minimal += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1
# $(run) contains all available tests
run := make_pure
@@ -94,6 +95,7 @@ run += make_no_libnuma
run += make_no_libaudit
run += make_no_libbionic
run += make_no_auxtrace
+run += make_no_libbpf
run += make_help
run += make_doc
run += make_perf_o
--
2.1.0
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH 8/8] perf tools: Make perf depend on libbpf
2015-09-21 21:23 ` [PATCH 8/8] perf tools: Make perf depend on libbpf Arnaldo Carvalho de Melo
@ 2015-09-22 7:02 ` Jiri Olsa
2015-09-22 13:12 ` Arnaldo Carvalho de Melo
2015-09-22 7:03 ` Jiri Olsa
1 sibling, 1 reply; 19+ messages in thread
From: Jiri Olsa @ 2015-09-22 7:02 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Wang Nan, Brendan Gregg,
Daniel Borkmann, David Ahern, He Kuang, Kaixu Xia,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Zefan Li, pi3orama, Arnaldo Carvalho de Melo
On Mon, Sep 21, 2015 at 06:23:21PM -0300, Arnaldo Carvalho de Melo wrote:
SNIP
> + NO_LIBBPF := 1
> else
> ifneq ($(filter s% -static%,$(LDFLAGS),),)
> msg := $(error No static glibc found, please install glibc-static);
> @@ -309,6 +312,13 @@ ifndef NO_LIBELF
> $(call detected,CONFIG_DWARF)
> endif # PERF_HAVE_DWARF_REGS
> endif # NO_DWARF
> +
> + ifndef NO_LIBBPF
> + ifeq ($(feature-bpf), 1)
> + CFLAGS += -DHAVE_LIBBPF_SUPPORT
> + $(call detected,CONFIG_LIBBPF)
what depends on CONFIG_LIBBPF ? I dont see any object being dependent on it
jirka
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 8/8] perf tools: Make perf depend on libbpf
2015-09-22 7:02 ` Jiri Olsa
@ 2015-09-22 13:12 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-22 13:12 UTC (permalink / raw)
To: Jiri Olsa
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Wang Nan, Brendan Gregg,
Daniel Borkmann, David Ahern, He Kuang, Kaixu Xia,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Zefan Li, pi3orama
Em Tue, Sep 22, 2015 at 09:02:59AM +0200, Jiri Olsa escreveu:
> On Mon, Sep 21, 2015 at 06:23:21PM -0300, Arnaldo Carvalho de Melo wrote:
>
> SNIP
>
> > + NO_LIBBPF := 1
> > else
> > ifneq ($(filter s% -static%,$(LDFLAGS),),)
> > msg := $(error No static glibc found, please install glibc-static);
> > @@ -309,6 +312,13 @@ ifndef NO_LIBELF
> > $(call detected,CONFIG_DWARF)
> > endif # PERF_HAVE_DWARF_REGS
> > endif # NO_DWARF
> > +
> > + ifndef NO_LIBBPF
> > + ifeq ($(feature-bpf), 1)
> > + CFLAGS += -DHAVE_LIBBPF_SUPPORT
> > + $(call detected,CONFIG_LIBBPF)
>
> what depends on CONFIG_LIBBPF ? I dont see any object being dependent on it
Nothing, as far as this patchkit goes, that is why I said this in the
cover letter:
---------------------------------------------------------------
The last one is not planned for my next perf/core pull req to
Ingo, still requires some more work, but is necessary so that we can
exercise the tools/build/ features fixed/introduced in this patchkit.
---------------------------------------------------------------
https://lkml.kernel.org/r/1442870601-26004-1-git-send-email-acme@kernel.org
- Arnaldo
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 8/8] perf tools: Make perf depend on libbpf
2015-09-21 21:23 ` [PATCH 8/8] perf tools: Make perf depend on libbpf Arnaldo Carvalho de Melo
2015-09-22 7:02 ` Jiri Olsa
@ 2015-09-22 7:03 ` Jiri Olsa
2015-09-22 13:18 ` Arnaldo Carvalho de Melo
1 sibling, 1 reply; 19+ messages in thread
From: Jiri Olsa @ 2015-09-22 7:03 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Wang Nan, Brendan Gregg,
Daniel Borkmann, David Ahern, He Kuang, Kaixu Xia,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Zefan Li, pi3orama, Arnaldo Carvalho de Melo
On Mon, Sep 21, 2015 at 06:23:21PM -0300, Arnaldo Carvalho de Melo wrote:
> From: Wang Nan <wangnan0@huawei.com>
>
> By adding libbpf into perf's Makefile, this patch enables perf to build
> libbpf during building if libelf is found and neither NO_LIBELF nor
> NO_LIBBPF is set. The newly introduced code is similar to libapi and
> libtraceevent building in Makefile.perf.
>
> MANIFEST is also updated for 'make perf-*-src-pkg'.
>
> Append make_no_libbpf to tools/perf/tests/make.
>
> 'bpf' feature check is appended into default FEATURE_TESTS and
> FEATURE_DISPLAY, so perf will check API version of bpf in
> /path/to/kernel/include/uapi/linux/bpf.h. Which should not fail except
> when we are trying to port this code to an old kernel.
>
> Error messages are also updated to notify users about the disable of BPF
> support of 'perf record' if libelf is missed or BPF API check failed.
>
> tools/lib/bpf is added into TAG_FOLDERS to allow us to navigate on
> libbpf files when working on perf using tools/perf/tags.
>
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Acked-by: Alexei Starovoitov <ast@plumgrid.com>
> Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: He Kuang <hekuang@huawei.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Kaixu Xia <xiakaixu@huawei.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Zefan Li <lizefan@huawei.com>
> Cc: pi3orama@163.com
> Link: http://lkml.kernel.org/r/1441523623-152703-3-git-send-email-wangnan0@huawei.com
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> tools/build/Makefile.feature | 6 ++++--
> tools/perf/MANIFEST | 3 +++
> tools/perf/Makefile.perf | 19 +++++++++++++++++--
> tools/perf/config/Makefile | 19 ++++++++++++++++++-
> tools/perf/tests/make | 4 +++-
> 5 files changed, 45 insertions(+), 6 deletions(-)
>
missing doc hunk in Makefile.perf
jirka
---
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 8af786f458df..bb949c9e818a 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -75,6 +75,8 @@ include config/utilities.mak
# Define NO_LZMA if you do not want to support compressed (xz) kernel modules
#
# Define NO_AUXTRACE if you do not want AUX area tracing support
+#
+# Define NO_BPF if you do not want BPF support
# As per kernel Makefile, avoid funny character set dependencies
unexport LC_ALL
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 8/8] perf tools: Make perf depend on libbpf
2015-09-22 7:03 ` Jiri Olsa
@ 2015-09-22 13:18 ` Arnaldo Carvalho de Melo
2015-09-22 13:31 ` Jiri Olsa
0 siblings, 1 reply; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-22 13:18 UTC (permalink / raw)
To: Jiri Olsa
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Wang Nan, Brendan Gregg,
Daniel Borkmann, David Ahern, He Kuang, Kaixu Xia,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Zefan Li, pi3orama
Em Tue, Sep 22, 2015 at 09:03:40AM +0200, Jiri Olsa escreveu:
> missing doc hunk in Makefile.perf
Ok, adding this. Thanks! So, with that comment about FEATURE_DUMP fixed:
https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/ebpf&id=c1500a11e9b3ec5546233013b7c4b64af103c617
Can I have your acks? :-)
- Arnaldo
> jirka
>
>
> ---
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 8af786f458df..bb949c9e818a 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -75,6 +75,8 @@ include config/utilities.mak
> # Define NO_LZMA if you do not want to support compressed (xz) kernel modules
> #
> # Define NO_AUXTRACE if you do not want AUX area tracing support
> +#
> +# Define NO_BPF if you do not want BPF support
>
> # As per kernel Makefile, avoid funny character set dependencies
> unexport LC_ALL
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 8/8] perf tools: Make perf depend on libbpf
2015-09-22 13:18 ` Arnaldo Carvalho de Melo
@ 2015-09-22 13:31 ` Jiri Olsa
2015-09-22 13:40 ` Arnaldo Carvalho de Melo
2015-09-22 13:55 ` Arnaldo Carvalho de Melo
0 siblings, 2 replies; 19+ messages in thread
From: Jiri Olsa @ 2015-09-22 13:31 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Wang Nan, Brendan Gregg,
Daniel Borkmann, David Ahern, He Kuang, Kaixu Xia,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Zefan Li, pi3orama
On Tue, Sep 22, 2015 at 10:18:07AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Sep 22, 2015 at 09:03:40AM +0200, Jiri Olsa escreveu:
> > missing doc hunk in Makefile.perf
>
> Ok, adding this. Thanks! So, with that comment about FEATURE_DUMP fixed:
>
> https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/ebpf&id=c1500a11e9b3ec5546233013b7c4b64af103c617
>
> Can I have your acks? :-)
would be easier if you resend, anyway:
tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf Arnaldo Carvalho de Melo 2 -1/+2
- ack
tools build: Allow setting the feature detection user Arnaldo Carvalho de Melo 1 -2/+3
- missing doc hunk which is in above patch, but ack..
tools lib ebpf: Fix up FEATURE_{TESTS,DISPLAY} usage Arnaldo Carvalho de Melo 1 -2/+2
- ack
tools build: Fixup feature detection display function name Arnaldo Carvalho de Melo 1 -1/+1
- ack
jirka
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 8/8] perf tools: Make perf depend on libbpf
2015-09-22 13:31 ` Jiri Olsa
@ 2015-09-22 13:40 ` Arnaldo Carvalho de Melo
2015-09-22 13:55 ` Arnaldo Carvalho de Melo
1 sibling, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-22 13:40 UTC (permalink / raw)
To: Jiri Olsa
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Wang Nan, Brendan Gregg,
Daniel Borkmann, David Ahern, He Kuang, Kaixu Xia,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Zefan Li, pi3orama
Em Tue, Sep 22, 2015 at 03:31:36PM +0200, Jiri Olsa escreveu:
> On Tue, Sep 22, 2015 at 10:18:07AM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Sep 22, 2015 at 09:03:40AM +0200, Jiri Olsa escreveu:
> > > missing doc hunk in Makefile.perf
> >
> > Ok, adding this. Thanks! So, with that comment about FEATURE_DUMP fixed:
> >
> > https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/ebpf&id=c1500a11e9b3ec5546233013b7c4b64af103c617
> >
> > Can I have your acks? :-)
>
> would be easier if you resend, anyway:
I'll try to do it next time, i.e. go on resubmitting with v(N++) series till
I get the acks, thanks for the ones here tho,
- Arnaldo
> tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf Arnaldo Carvalho de Melo 2 -1/+2
> - ack
>
> tools build: Allow setting the feature detection user Arnaldo Carvalho de Melo 1 -2/+3
> - missing doc hunk which is in above patch, but ack..
>
> tools lib ebpf: Fix up FEATURE_{TESTS,DISPLAY} usage Arnaldo Carvalho de Melo 1 -2/+2
> - ack
>
> tools build: Fixup feature detection display function name Arnaldo Carvalho de Melo 1 -1/+1
> - ack
>
>
> jirka
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 8/8] perf tools: Make perf depend on libbpf
2015-09-22 13:31 ` Jiri Olsa
2015-09-22 13:40 ` Arnaldo Carvalho de Melo
@ 2015-09-22 13:55 ` Arnaldo Carvalho de Melo
1 sibling, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-22 13:55 UTC (permalink / raw)
To: Jiri Olsa
Cc: Jiri Olsa, Ingo Molnar, linux-kernel, Wang Nan, Brendan Gregg,
Daniel Borkmann, David Ahern, He Kuang, Kaixu Xia,
Masami Hiramatsu, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Zefan Li, pi3orama
Em Tue, Sep 22, 2015 at 03:31:36PM +0200, Jiri Olsa escreveu:
> On Tue, Sep 22, 2015 at 10:18:07AM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Sep 22, 2015 at 09:03:40AM +0200, Jiri Olsa escreveu:
> > > missing doc hunk in Makefile.perf
> >
> > Ok, adding this. Thanks! So, with that comment about FEATURE_DUMP fixed:
> >
> > https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/ebpf&id=c1500a11e9b3ec5546233013b7c4b64af103c617
> >
> > Can I have your acks? :-)
>
> would be easier if you resend, anyway:
>
> tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf Arnaldo Carvalho de Melo 2 -1/+2
> - ack
>
> tools build: Allow setting the feature detection user Arnaldo Carvalho de Melo 1 -2/+3
> - missing doc hunk which is in above patch, but ack..
Argh, I added the comment, but to "Use FEATURE_USER to allow bu...",
i.e. the wrong patch, fixed it:
"tools build: Allow setting the feature detection user"
https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/core&id=13e96db61c1c32cd4c8102a95129bb7677cc746d
"tools lib bpf: Use FEATURE_USER to allow building in the same dir as perf"
https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/core&id=65f041bee7838e2a91dbbc0a917d9291adbb3484
- Arnaldo
^ permalink raw reply [flat|nested] 19+ messages in thread