From patchwork Wed Sep 23 11:22:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 54034 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 95A1122E14 for ; Wed, 23 Sep 2015 11:24:16 +0000 (UTC) Received: by lamf6 with SMTP id f6sf21757812lam.1 for ; Wed, 23 Sep 2015 04:24:15 -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=b8I42MfEr/lbBJUzhcxESBLXWkNCjlM1PG9r3luvCSw=; b=bIUZmPZFrypfoyOCJqW+NM+5T4+qYwf5fxILPn35Fuc4rWFu6vqAtnlheTHEVp3gog AplLUfNuW176fPBMv6w4yyDD8Cm9JCw1Ft1U8lUoG641y5xM7kWXExsN8MDzWd4jx/ar itlRw5xBLNgRcBhcYkB5ChNVG9CcTvN2tewwRV5jcQE9Klwo+FPh/Ype5HI0AUaEisSX lEEeg0NHvetfsIZ+sI7jkeIExX9YLFV4vXqLj8z2Y6OisDki3SJnt9HcPadO/mxmfpye bN6YMIZhNPBcUbZr10M00pt83LS5iANJ2JBZc4Sl2MBicKeKZfwx8pVE1uK5q3HbwoGp l4Yw== X-Gm-Message-State: ALoCoQntpKOWDWLp9wq+lvIS0UPmNTwtv/QSJ4OnCD++ZT71wGQRRm2rad0x31/iA6Pyp7A6MOi7 X-Received: by 10.180.107.167 with SMTP id hd7mr502611wib.6.1443007455423; Wed, 23 Sep 2015 04:24:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.224.133 with SMTP id rc5ls29907lac.106.gmail; Wed, 23 Sep 2015 04:24:15 -0700 (PDT) X-Received: by 10.152.6.162 with SMTP id c2mr11414061laa.26.1443007455235; Wed, 23 Sep 2015 04:24:15 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id 6si3505203lav.58.2015.09.23.04.24.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Sep 2015 04:24:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by lahh2 with SMTP id h2so22061024lah.0 for ; Wed, 23 Sep 2015 04:24:14 -0700 (PDT) X-Received: by 10.152.37.135 with SMTP id y7mr11415658laj.106.1443007454771; Wed, 23 Sep 2015 04:24:14 -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 w3csp1043395lbq; Wed, 23 Sep 2015 04:24:13 -0700 (PDT) X-Received: by 10.68.68.134 with SMTP id w6mr37654277pbt.61.1443007453629; Wed, 23 Sep 2015 04:24:13 -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:13 -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 S1754520AbbIWLXu (ORCPT + 30 others); Wed, 23 Sep 2015 07:23:50 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:56816 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754435AbbIWLXo (ORCPT ); Wed, 23 Sep 2015 07:23:44 -0400 Received: from 172.24.1.49 (EHLO szxeml426-hub.china.huawei.com) ([172.24.1.49]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BNW12503; Wed, 23 Sep 2015 19:23:12 +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:01 +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 07/22] perf record: Add clang options for compiling BPF scripts Date: Wed, 23 Sep 2015 11:22:28 +0000 Message-ID: <1443007363-124182-8-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 X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A010204.56028BA0.010B, 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: d114a9ac3e12d8422754946be18d95bb 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.45 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: , Although previous patch allows setting BPF compiler related options in perfconfig, on some ad-hoc situation it still requires passing options through cmdline. This patch introduces 2 options to 'perf record' for this propose: --clang-path and --clang-opt. 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/builtin-record.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 142eeb3..ea3eef6 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -31,6 +31,7 @@ #include "util/auxtrace.h" #include "util/parse-branch-options.h" #include "util/parse-regs-options.h" +#include "util/llvm-utils.h" #include #include @@ -1096,6 +1097,12 @@ struct option __record_options[] = { "per thread proc mmap processing timeout in ms"), OPT_BOOLEAN(0, "switch-events", &record.opts.record_switch_events, "Record context switch events"), +#ifdef HAVE_LIBBPF_SUPPORT + OPT_STRING(0, "clang-path", &llvm_param.clang_path, "clang path", + "clang binary to use for compiling BPF scriptlets"), + OPT_STRING(0, "clang-opt", &llvm_param.clang_opt, "clang options", + "options passed to clang when compiling BPF scriptlets"), +#endif OPT_END() };