From patchwork Wed Sep 23 11:22:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 54035 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 5135722F10 for ; Wed, 23 Sep 2015 11:24:17 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf22584138wic.1 for ; Wed, 23 Sep 2015 04:24:16 -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=WS7yk6A+aUPy4550I+HK42Ss8b8YYwUnEgXU9wXo13Q2ZcohUsKjO0yD/1WCmDT05J 9gUJPSzoHvDzoAJqdz2pGgxeu86yotV6oC7VhhqXVStkeHz1vIJaPxMRz54fITeBN6YK ZJ+GdD0CY5sDlo75vZiRrmshSwXiSiyTVrl5MZlhLsOP69A8DPlgfA3Y57EReqihPHTJ zpKNA21aL/m2ajWsT6qFiXaYs3Lx4yT5prLTfZpKAGutJm0xMGsTJKNlPAhM8Y5DK/PG 6Zewf/7NGnlUPHj0F1Rp6N366I7wEKQMbaytFd4lktMznQ3tV6bPDqp88nzamnvf8HKW 9F7Q== X-Gm-Message-State: ALoCoQnZgFetezHxUisVRp8VI4sVxA2iaDaYX6wbTuvS9l3H3ZvU0p7RwaXROcn4jYkKurqFJKuJ X-Received: by 10.112.140.195 with SMTP id ri3mr5275695lbb.22.1443007456567; Wed, 23 Sep 2015 04:24:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.202 with SMTP id d10ls35022lah.43.gmail; Wed, 23 Sep 2015 04:24:16 -0700 (PDT) X-Received: by 10.112.147.135 with SMTP id tk7mr11366465lbb.100.1443007456275; Wed, 23 Sep 2015 04:24:16 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id n8si1642068lbs.50.2015.09.23.04.24.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Sep 2015 04:24:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagj9 with SMTP id j9so46344329lag.2 for ; Wed, 23 Sep 2015 04:24:16 -0700 (PDT) X-Received: by 10.152.23.97 with SMTP id l1mr5436995laf.56.1443007456014; Wed, 23 Sep 2015 04:24:16 -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 w3csp1043404lbq; Wed, 23 Sep 2015 04:24:14 -0700 (PDT) X-Received: by 10.68.65.104 with SMTP id w8mr37382445pbs.48.1443007454128; Wed, 23 Sep 2015 04:24:14 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yb7si9930560pbc.53.2015.09.23.04.24.13; Wed, 23 Sep 2015 04:24:14 -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 S1754549AbbIWLXx (ORCPT + 30 others); Wed, 23 Sep 2015 07:23:53 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:19597 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754517AbbIWLXu (ORCPT ); Wed, 23 Sep 2015 07:23:50 -0400 Received: from 172.24.1.48 (EHLO szxeml426-hub.china.huawei.com) ([172.24.1.48]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CTE39078; Wed, 23 Sep 2015 19:23:17 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml426-hub.china.huawei.com (10.82.67.181) with Microsoft SMTP Server id 14.3.235.1; Wed, 23 Sep 2015 19:23:07 +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 , Zefan Li Subject: [PATCH 13/22] perf tools: Add BPF_PROLOGUE config options for further patches Date: Wed, 23 Sep 2015 11:22:34 +0000 Message-ID: <1443007363-124182-14-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1443007363-124182-1-git-send-email-wangnan0@huawei.com> References: <1443007363-124182-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected 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.215.49 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