From patchwork Thu Oct 8 08:29:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 54640 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id C59AA22FF8 for ; Thu, 8 Oct 2015 08:39:44 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf19903684lbc.1 for ; Thu, 08 Oct 2015 01:39:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=wF3opWbGuuD06Hlm3vDXPacrOxDr8MDj23MeapfJjr4=; b=kvvJqQa/nCUTRIzFwMsH79VcN7L+1xSAA8L9UuJjm6fwELExT7zZmUA2/T+fiCE+2e vlUAgXw9QZD0+EGYAbWvT9GBieD/jjwUm87xR7iMjBNKS+sZFX5VN3PiM2cfoIal0ONe KltGHr0Xw2agvDXCThiNwBTXBBlIZ2zx3HRMKGTU6EcGL7UJac/Wg6gyvn5Pzrhv+3G3 /wYojWTqoM4nzMPOKlBpN8txfvTV80ismowcGdLIfDkyJNed0sneTWbfAApCxkstMHUE mp147inpSDjUFHGQ0cnBDB87UJyUb/rYaMcZeZ2nIe/OOqvjClowCz/QYGRQG06/EbmX zhxA== X-Gm-Message-State: ALoCoQmuvspolZZtj9XzcoO7ASD69qJfggj7s9r4wQpfhaQIMNLzJNKhAgFt6TxSnsOITsqHg//K X-Received: by 10.112.54.197 with SMTP id l5mr1097467lbp.21.1444293583780; Thu, 08 Oct 2015 01:39:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.218.207 with SMTP id r198ls161254lfg.40.gmail; Thu, 08 Oct 2015 01:39:43 -0700 (PDT) X-Received: by 10.112.204.101 with SMTP id kx5mr2955982lbc.93.1444293583478; Thu, 08 Oct 2015 01:39:43 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id n8si28803516lbs.50.2015.10.08.01.39.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Oct 2015 01:39:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbwr8 with SMTP id r8so38475838lbw.2 for ; Thu, 08 Oct 2015 01:39:43 -0700 (PDT) X-Received: by 10.25.28.73 with SMTP id c70mr1651742lfc.76.1444293583224; Thu, 08 Oct 2015 01:39:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp441607lbq; Thu, 8 Oct 2015 01:39:42 -0700 (PDT) X-Received: by 10.69.26.5 with SMTP id iu5mr6863573pbd.12.1444293581909; Thu, 08 Oct 2015 01:39:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tc9si64686905pac.230.2015.10.08.01.39.41; Thu, 08 Oct 2015 01:39:41 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754570AbbJHIji (ORCPT + 30 others); Thu, 8 Oct 2015 04:39:38 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:51314 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754476AbbJHIe5 (ORCPT ); Thu, 8 Oct 2015 04:34:57 -0400 Received: from 172.24.1.49 (EHLO szxeml427-hub.china.huawei.com) ([172.24.1.49]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BOO15942; Thu, 08 Oct 2015 16:30:49 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml427-hub.china.huawei.com (10.82.67.182) with Microsoft SMTP Server id 14.3.235.1; Thu, 8 Oct 2015 16:29:37 +0800 From: Wang Nan To: CC: , , , Wang Nan , Alexei Starovoitov , Brendan Gregg , Daniel Borkmann , David Ahern , He Kuang , Jiri Olsa , Kaixu Xia , Masami Hiramatsu , Namhyung Kim , Paul Mackerras , Peter Zijlstra Subject: [PATCH 14/22] perf tools: Add BPF_PROLOGUE config options for further patches Date: Thu, 8 Oct 2015 08:29:36 +0000 Message-ID: <1444292984-13135-15-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1444292984-13135-1-git-send-email-wangnan0@huawei.com> References: <1444292984-13135-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.56162A80.011F, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: c5998c024d59c78f45c6f924556898c1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: wangnan0@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If both LIBBPF and DWARF are detected, it is possible to create prologue for eBPF programs to help them accessing kernel data. HAVE_BPF_PROLOGUE and CONFIG_BPF_PROLOGUE is added as flags for this feature. PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET indicates an architecture supports converting name of a register to its offset in 'struct pt_regs'. Without this support, BPF_PROLOGUE should be turned off. HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET is introduced as the corresponding CFLAGS of PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET. Signed-off-by: Wang Nan Cc: Alexei Starovoitov Cc: Brendan Gregg Cc: Daniel Borkmann Cc: David Ahern Cc: He Kuang Cc: Jiri Olsa Cc: Kaixu Xia Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Zefan Li Cc: pi3orama@163.com Cc: Arnaldo Carvalho de Melo Link: http://lkml.kernel.org/n/ebpf-6yw9eg0ej3l4jnqhinngkw86@git.kernel.org --- tools/perf/config/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index de89ec5..6eb9a95 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