From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Wang Nan <wangnan0@huawei.com>,
Alexei Starovoitov <ast@kernel.org>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Zefan Li <lizefan@huawei.com>,
pi3orama@163.com, Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 04/16] perf bpf: Add BPF_PROLOGUE config options for further patches
Date: Tue, 17 Nov 2015 12:31:19 -0300 [thread overview]
Message-ID: <1447774291-14532-5-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1447774291-14532-1-git-send-email-acme@kernel.org>
From: Wang Nan <wangnan0@huawei.com>
If both LIBBPF and DWARF are detected, it is possible to create prologue
for eBPF programs to help them access kernel data. HAVE_BPF_PROLOGUE and
CONFIG_BPF_PROLOGUE are added as flags for this feature.
PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET is introduced in commit
63ab024a5b6f295ca17a293ad81b7c728f49a89a ("perf tools:
regs_query_register_offset() infrastructure"), which indicates that an
architecture supports converting name of a register to its offset in
'struct pt_regs'. Without this support, BPF_PROLOGUE should be turned
off.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1447675815-166222-9-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/config/Makefile | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index de89ec574361..6eb9a956a408 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -318,6 +318,18 @@ ifndef NO_LIBELF
CFLAGS += -DHAVE_LIBBPF_SUPPORT
$(call detected,CONFIG_LIBBPF)
endif
+
+ ifndef NO_DWARF
+ ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
+ CFLAGS += -DHAVE_BPF_PROLOGUE
+ $(call detected,CONFIG_BPF_PROLOGUE)
+ else
+ msg := $(warning BPF prologue is not supported by architecture $(ARCH), missing regs_query_register_offset());
+ endif
+ else
+ msg := $(warning DWARF support is off, BPF prologue is disabled);
+ endif
+
endif # NO_LIBBPF
endif # NO_LIBELF
--
2.1.0
next prev parent reply other threads:[~2015-11-17 15:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 15:31 [GIT PULL 00/16] perf/ebpf improvements and fixes Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 01/16] tools: Adopt memdup() from tools/perf, moving it to tools/lib/string.c Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 02/16] tools: Clone the kernel's strtobool function Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 03/16] bpf tools: Load a program with different instances using preprocessor Arnaldo Carvalho de Melo
2015-11-17 15:31 ` Arnaldo Carvalho de Melo [this message]
2015-11-17 15:31 ` [PATCH 05/16] perf bpf: Compile dwarf-regs.c if CONFIG_BPF_PROLOGUE is on Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 06/16] perf bpf: Allow BPF program attach to uprobe events Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 07/16] perf bpf: Allow attaching BPF programs to modules symbols Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 08/16] perf bpf: Allow BPF program config probing options Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 09/16] perf bpf: Add prologue for BPF programs for fetching arguments Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 10/16] perf bpf: Generate prologue for BPF programs Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 11/16] perf test: Test the BPF prologue adding infrastructure Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 12/16] perf test: Fix 'perf test BPF' when it fails to find a suitable vmlinux Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 13/16] perf bpf: Use same BPF program if arguments are identical Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 14/16] perf test: Print result for each LLVM subtest Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 15/16] perf test: Print result for each BPF subtest Arnaldo Carvalho de Melo
2015-11-17 15:31 ` [PATCH 16/16] perf test: Mute test cases error messages if verbose == 0 Arnaldo Carvalho de Melo
2015-11-18 6:32 ` [GIT PULL 00/16] perf/ebpf improvements and fixes Ingo Molnar
2015-11-18 12:44 ` Arnaldo Carvalho de Melo
2015-11-18 13:06 ` pi3orama
2015-11-18 13:27 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447774291-14532-5-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=ast@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.