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


Groups > linux.kernel > #1272936

[PATCH] tools lib bpf: Don't feature check when cleaning

Path csiph.com!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!bofh.it!news.nic.it!robomod
From Wang Nan <wangnan0@huawei.com>
Newsgroups linux.kernel
Subject [PATCH] tools lib bpf: Don't feature check when cleaning
Date Thu, 19 Nov 2015 09:50:01 +0100
Message-ID <qwt4J-6WM-5@gated-at.bofh.it> (permalink)
X-Original-To <acme@kernel.org>, <jolsa@kernel.org>
X-Mailer git-send-email 1.8.3.4
MIME-Version 1.0
Content-Type text/plain
X-Originating-IP [10.107.193.248]
X-Cfilter-Loop Reflected
X-Mirapoint-Virus-Rapid-Raw score=unknown(0), refid=str=0001.0A020202.564D8C1F.00C3,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32
X-Mirapoint-Loop-ID 09f2af78bce74ebd30db1dec82d5009b
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 72
Organization linux.* mail to news gateway
X-Original-Cc <lizefan@huawei.com>, <pi3orama@163.com>, <linux-kernel@vger.kernel.org>, Wang Nan <wangnan0@huawei.com>
X-Original-Date Thu, 19 Nov 2015 08:45:06 +0000
X-Original-Message-ID <1447922706-99905-1-git-send-email-wangnan0@huawei.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1272936

Show key headers only | View raw


Before this patch libbpf always do feature check even when cleaning.
For example:

 $ cd kernel/tools/lib/bpf
 $ make

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

   CC       libbpf.o
   CC       bpf.o
   LD       libbpf-in.o
   LINK     libbpf.a
   LINK     libbpf.so
 $ make clean
   CLEAN    libbpf
   CLEAN    core-gen
 $ make clean

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

   CLEAN    libbpf
   CLEAN    core-gen
 $

Although the first 'make clean' doesn't show feature check result,
it still does the check. No output because check result is similar
to FEATURE-DUMP.libbpf.

This patch uses same method as perf to turn off feature checking
when 'make clean'.

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
---
 tools/lib/bpf/Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index a3caaf3..636e3dd 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -71,7 +71,17 @@ 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)
 
+check_feat := 1
+NON_CHECK_FEAT_TARGETS := clean TAGS tags cscope help
+ifdef MAKECMDGOALS
+ifeq ($(filter-out $(NON_CHECK_FEAT_TARGETS),$(MAKECMDGOALS)),)
+  check_feat := 0
+endif
+endif
+
+ifeq ($(check_feat),1)
 include $(srctree)/tools/build/Makefile.feature
+endif
 
 export prefix libdir src obj
 
-- 
1.8.3.4

--
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 | Next | Find similar | Unroll thread


Thread

[PATCH] tools lib bpf: Don't feature check when cleaning Wang Nan <wangnan0@huawei.com> - 2015-11-19 09:50 +0100

csiph-web