From patchwork Thu Oct 8 08:29:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 54642 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id B1DFB22FF8 for ; Thu, 8 Oct 2015 08:40:57 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf19919708lbc.1 for ; Thu, 08 Oct 2015 01:40:56 -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=eRGBJ1uYgMExhtJnlc38lgVsudklvNbjfi8VdnqzR/9Tfxdfjr3BhdFrb4tl7AeF+1 wqyfGHPIDdJvYP2/t0ggjCxaoXz43S30jhGNgMtLHZQYNLpyfSV9+DQd7xB+UmxvwvSI XFyoA7YA9KzamIWsweFW6c+sVz9dChaZgQChkH9120Y7X6UjH0NegmUNVsOgEm01DJMW Y3NREIPyf5xjCmw+IWJAcgON1Y0jX3X+QogeSTirLTRoFdv8EzToE5WXtPZ5nVwAiz+e 53HnvZV4yWYda7nhcIh3XBhA0zRfpaijpQKAN7UQKp20BJgvWF0GjWBSxOA3TKKVAldq A3MA== X-Gm-Message-State: ALoCoQl9M+31SEqLmHB0BZ54NrHzyzCDIGVWLvmNzM1ae32FMokozeS2jURXootFhOod7Y6GQsGX X-Received: by 10.112.145.3 with SMTP id sq3mr1136464lbb.7.1444293656668; Thu, 08 Oct 2015 01:40:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.218.208 with SMTP id r199ls162012lfg.2.gmail; Thu, 08 Oct 2015 01:40:56 -0700 (PDT) X-Received: by 10.25.152.211 with SMTP id a202mr1956816lfe.66.1444293656369; Thu, 08 Oct 2015 01:40:56 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id bm7si28801561lbc.82.2015.10.08.01.40.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Oct 2015 01:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbcao8 with SMTP id ao8so39173878lbc.3 for ; Thu, 08 Oct 2015 01:40:56 -0700 (PDT) X-Received: by 10.112.180.230 with SMTP id dr6mr2970208lbc.72.1444293656065; Thu, 08 Oct 2015 01:40:56 -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 w3csp442149lbq; Thu, 8 Oct 2015 01:40:55 -0700 (PDT) X-Received: by 10.67.4.230 with SMTP id ch6mr6839924pad.11.1444293654965; Thu, 08 Oct 2015 01:40:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc4si64730908pad.141.2015.10.08.01.40.54; Thu, 08 Oct 2015 01:40:54 -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 S1754645AbbJHIkv (ORCPT + 30 others); Thu, 8 Oct 2015 04:40:51 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:49656 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754111AbbJHIcE (ORCPT ); Thu, 8 Oct 2015 04:32:04 -0400 Received: from 172.24.1.48 (EHLO szxeml427-hub.china.huawei.com) ([172.24.1.48]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CTW16114; Thu, 08 Oct 2015 16:29:56 +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:32 +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 08/22] perf record: Add clang options for compiling BPF scripts Date: Thu, 8 Oct 2015 08:29:30 +0000 Message-ID: <1444292984-13135-9-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 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.182 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() };