From patchwork Wed Oct 14 12:41:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 54927 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 5DE3323012 for ; Wed, 14 Oct 2015 12:44:47 +0000 (UTC) Received: by wicid10 with SMTP id id10sf25726874wic.2 for ; Wed, 14 Oct 2015 05:44:46 -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=ViqEgP7BCBcNleZLJs1II6EwWuz4MLBn2i8HY7eaBEbgJRumMYwXlWq6hqVUpY/ZMv jooVD5r3QzzxnbSO4wtWecgx9EQN1qMKI3WWzwSl8vlR62qBr8eA87X+bTmGfHj5CkIW sAizzQwG+VgpYRO/yPzdZ6jwDOaUy52BP6oL4Ew+SWIfr+Uug2l4ybjX+5aC5N63B0UQ 8QvGeE4b51B9CwO9zY982rPm3+XZHu4y+9kZqg8IkzR1Hl+hzZNYgk+kqzU6QWgzhHcS dsRpdUd/J4Ib2n3oB89JVm2fGpbIncUw7F+K0jQlbakghzwDaTh254H+R4MaiZjscpxd B8dQ== X-Gm-Message-State: ALoCoQmpfGKv+EHnshmcexWT2Ttjhl1Fwg+YD8waX00jyIUroBgghGcTzHCPPev4p2GoEIXTKM4g X-Received: by 10.112.63.165 with SMTP id h5mr743840lbs.18.1444826686694; Wed, 14 Oct 2015 05:44:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.17.203 with SMTP id 72ls33090lfr.24.gmail; Wed, 14 Oct 2015 05:44:46 -0700 (PDT) X-Received: by 10.25.151.74 with SMTP id z71mr971657lfd.105.1444826686536; Wed, 14 Oct 2015 05:44:46 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id f184si5429805lfg.131.2015.10.14.05.44.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 05:44:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbcao8 with SMTP id ao8so45245353lbc.3 for ; Wed, 14 Oct 2015 05:44:46 -0700 (PDT) X-Received: by 10.112.151.106 with SMTP id up10mr1520451lbb.106.1444826686053; Wed, 14 Oct 2015 05:44:46 -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 w3csp2710597lbq; Wed, 14 Oct 2015 05:44:45 -0700 (PDT) X-Received: by 10.68.231.137 with SMTP id tg9mr3520239pbc.143.1444826685035; Wed, 14 Oct 2015 05:44:45 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si13076528pbq.64.2015.10.14.05.44.44; Wed, 14 Oct 2015 05:44:45 -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 S932295AbbJNMog (ORCPT + 30 others); Wed, 14 Oct 2015 08:44:36 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:4067 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753659AbbJNMnF (ORCPT ); Wed, 14 Oct 2015 08:43:05 -0400 Received: from 172.24.1.49 (EHLO szxeml425-hub.china.huawei.com) ([172.24.1.49]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUF02906; Wed, 14 Oct 2015 20:42:33 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml425-hub.china.huawei.com (10.82.67.180) with Microsoft SMTP Server id 14.3.235.1; Wed, 14 Oct 2015 20:42:21 +0800 From: Wang Nan To: , , CC: , , , , , , , , , , , , Wang Nan , Arnaldo Carvalho de Melo Subject: [PATCH 14/31] perf tools: Add BPF_PROLOGUE config options for further patches Date: Wed, 14 Oct 2015 12:41:25 +0000 Message-ID: <1444826502-49291-15-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1444826502-49291-1-git-send-email-wangnan0@huawei.com> References: <1444826502-49291-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.217.170 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