From patchwork Wed Oct 14 12:41:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 54921 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id AF81323012 for ; Wed, 14 Oct 2015 12:43:27 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf25971981wic.3 for ; Wed, 14 Oct 2015 05:43:27 -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=UXXQlsklz10NccbhxXFa7jZrtZDtq8ceyXSglAF+/Oc=; b=C/ImHQUv1GSTqho+EUYvSYXEosXgLKO8yPDFEHqyLMokod8QOTFFVVPms9zei4Kpig 5Mxb1pV3SGpbfufO7VNEqumzCoXwecsXAlMwHyrO/z2bTAqi3bqIfXERvEZ/zONSyeiW +jh02u3YEV4qJfGhA0QZ8fOBsBF7X8Tl6dFWi7Vs7j3VtF+q/FL3Us+I6K8dACZmNkS9 ZTkfWKF3kBHKT796WiqGfA3LQbUiJekmRAk12mF7W2sK1Hcer0fWzwzTVQod+up7KB+w VApObXsNMTOM0VLVaeif9XVqexZIISTRMFbCEbOUMd4eoBmVd/p5Z2u3W4ikdRCJiXiN +j8Q== X-Gm-Message-State: ALoCoQlF98a7q+iSBcbdDby1TWrcpgyZip+QQm6J/6MmwrlBLqjBUzoLims7AwXpz7wKbYgn+FIN X-Received: by 10.112.184.170 with SMTP id ev10mr748206lbc.4.1444826606976; Wed, 14 Oct 2015 05:43:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.205.7 with SMTP id d7ls35078lfg.82.gmail; Wed, 14 Oct 2015 05:43:26 -0700 (PDT) X-Received: by 10.25.207.82 with SMTP id f79mr998622lfg.73.1444826606809; Wed, 14 Oct 2015 05:43:26 -0700 (PDT) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id b7si5417619lfb.164.2015.10.14.05.43.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 05:43:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lffv3 with SMTP id v3so10663858lff.0 for ; Wed, 14 Oct 2015 05:43:26 -0700 (PDT) X-Received: by 10.25.38.9 with SMTP id m9mr960324lfm.112.1444826606547; Wed, 14 Oct 2015 05:43:26 -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 w3csp2709997lbq; Wed, 14 Oct 2015 05:43:25 -0700 (PDT) X-Received: by 10.68.107.133 with SMTP id hc5mr3548893pbb.5.1444826599525; Wed, 14 Oct 2015 05:43:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qa3si13069602pbc.31.2015.10.14.05.43.19; Wed, 14 Oct 2015 05:43: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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753702AbbJNMnJ (ORCPT + 30 others); Wed, 14 Oct 2015 08:43:09 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:50238 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753522AbbJNMmp (ORCPT ); Wed, 14 Oct 2015 08:42:45 -0400 Received: from 172.24.1.49 (EHLO szxeml425-hub.china.huawei.com) ([172.24.1.49]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CWT05941; Wed, 14 Oct 2015 20:42:23 +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:15 +0800 From: Wang Nan To: , , CC: , , , , , , , , , , , , Wang Nan , Arnaldo Carvalho de Melo Subject: [PATCH 08/31] perf record: Add clang options for compiling BPF scripts Date: Wed, 14 Oct 2015 12:41:19 +0000 Message-ID: <1444826502-49291-9-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.215.42 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 24ace2f..847cc67 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 @@ -1117,6 +1118,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() };