From patchwork Sun Jun 26 11:21:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: He Kuang X-Patchwork-Id: 70878 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp615448qgy; Sun, 26 Jun 2016 04:22:24 -0700 (PDT) X-Received: by 10.66.148.105 with SMTP id tr9mr24126061pab.72.1466940139886; Sun, 26 Jun 2016 04:22:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2si18961657pal.26.2016.06.26.04.22.19; Sun, 26 Jun 2016 04:22:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752603AbcFZLWP (ORCPT + 30 others); Sun, 26 Jun 2016 07:22:15 -0400 Received: from szxga04-in.huawei.com ([58.251.152.52]:21056 "EHLO szxga04-in.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752411AbcFZLWD (ORCPT ); Sun, 26 Jun 2016 07:22:03 -0400 Received: from 172.24.1.46 (EHLO lggeml424-hub.china.huawei.com) ([172.24.1.46]) by szxrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id BSN99104; Sun, 26 Jun 2016 19:10:57 +0800 (CST) Received: from euler.hulk-profiling (10.107.193.250) by lggeml424-hub.china.huawei.com (10.72.61.34) with Microsoft SMTP Server id 14.3.235.1; Sun, 26 Jun 2016 19:21:31 +0800 From: He Kuang To: , , , , , , , , CC: Subject: [RFC PATCH v2 08/26] perf bpf: Add UBPF flags and makefile options Date: Sun, 26 Jun 2016 11:21:00 +0000 Message-ID: <1466940078-65581-9-git-send-email-hekuang@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1466940078-65581-1-git-send-email-hekuang@huawei.com> References: <1466940078-65581-1-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.576FBACF.0008, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 83e6772ef8e37f7034450371df8a5535 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Nan UBPF are not built by default, unless user explicitly build perf with UBPF defined. Signed-off-by: Wang Nan Signed-off-by: He Kuang --- tools/lib/bpf/Makefile | 4 ++++ tools/perf/Makefile.perf | 2 ++ tools/perf/config/Makefile | 4 ++++ 3 files changed, 10 insertions(+) -- 1.8.5.2 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