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


Groups > linux.kernel > #1431440

[RFC PATCH v2 08/26] perf bpf: Add UBPF flags and makefile options

From He Kuang <hekuang@huawei.com>
Newsgroups linux.kernel
Subject [RFC PATCH v2 08/26] perf bpf: Add UBPF flags and makefile options
Date 2016-06-26 13:30 +0200
Message-ID <rOgqd-2jQ-1@gated-at.bofh.it> (permalink)
References <rOgqd-2jQ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Wang Nan <wangnan0@huawei.com>

UBPF are not built by default, unless user explicitly build perf with
UBPF defined.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: He Kuang <hekuang@huawei.com>
---
 tools/lib/bpf/Makefile     | 4 ++++
 tools/perf/Makefile.perf   | 2 ++
 tools/perf/config/Makefile | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index fc1bc75..1fb098d 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -120,6 +120,10 @@ ifeq ($(feature-libelf-getphdrnum), 1)
   override CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
 endif
 
+ifdef UBPF
+    override CFLAGS += -DHAVE_UBPF_SUPPORT
+endif
+
 # Append required CFLAGS
 override CFLAGS += $(EXTRA_WARNINGS)
 override CFLAGS += -Werror -Wall
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index d0a2cb1..114a719 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -81,6 +81,8 @@ include ../scripts/utilities.mak
 #
 # Define NO_LIBBPF if you do not want BPF support
 #
+# Define UBPF if you DO want user space BPF support
+#
 # Define FEATURES_DUMP to provide features detection dump file
 # and bypass the feature detection
 
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 534c811..2a64534 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -329,6 +329,10 @@ ifndef NO_LIBELF
     ifeq ($(feature-bpf), 1)
       CFLAGS += -DHAVE_LIBBPF_SUPPORT
       $(call detected,CONFIG_LIBBPF)
+      ifdef UBPF
+        CFLAGS += -DHAVE_UBPF_SUPPORT
+        $(call detected,CONFIG_UBPF)
+      endif
     endif
 
     ifndef NO_DWARF
-- 
1.8.5.2

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


Thread

[RFC PATCH v2 08/26] perf bpf: Add UBPF flags and makefile options He Kuang <hekuang@huawei.com> - 2016-06-26 13:30 +0200

csiph-web