From patchwork Sat Aug 29 04:21:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 52823 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 7033A20503 for ; Sat, 29 Aug 2015 04:24:25 +0000 (UTC) Received: by wibcx1 with SMTP id cx1sf2675508wib.3 for ; Fri, 28 Aug 2015 21:24:24 -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=30AazbZX8BEk+W964Si/vgLVG6ZvZKIkbqDQjl//4b0=; b=TFg6o5Iyk5ky0UXZKfUCyxACyICb9CdUh8PMJHUH3+QzWXr5GFXNEqPccUbrW57hmO 8T5Bwrw1WuwbIvJIQQt+h4+3eHbWS78skbsFVcgyoAl6c6UH5kK0lFEs39QEmsRkEK5M RkGhkHzebG8AbFHZdblrc4m/HZYSvTQ3UHWMWgs0caZ11BoSEaAv0yC7LoxDw/vqPAul UJvHbk5s7wDoEdZZ6LRJ8Lw0BRFNcZ3uMFAI2twwrLDoVFu9XjkERbeX9lLnK6txLM52 NFhrIgSACP2PZB+6Q084sYUAdV5g6Av8mXuwIub+LlEyhnpd88B+iYNlgqi0BCrXqYdE /BHQ== X-Gm-Message-State: ALoCoQlbhsNikcOG1zrIGQuOo1Nmder4iJTb9J9AA1IRFWnNbDy54mam6c+gY7+v5pRdKL9bTYDO X-Received: by 10.180.90.106 with SMTP id bv10mr2015350wib.6.1440822264521; Fri, 28 Aug 2015 21:24:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.100 with SMTP id s4ls282468lag.83.gmail; Fri, 28 Aug 2015 21:24:24 -0700 (PDT) X-Received: by 10.152.5.69 with SMTP id q5mr6179394laq.92.1440822264072; Fri, 28 Aug 2015 21:24:24 -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 j6si7640447lbh.152.2015.08.28.21.24.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2015 21:24:24 -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 labnh1 with SMTP id nh1so18620907lab.3 for ; Fri, 28 Aug 2015 21:24:24 -0700 (PDT) X-Received: by 10.152.203.134 with SMTP id kq6mr6292100lac.106.1440822263957; Fri, 28 Aug 2015 21:24:23 -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.151.194 with SMTP id us2csp267584lbb; Fri, 28 Aug 2015 21:24:22 -0700 (PDT) X-Received: by 10.68.229.195 with SMTP id ss3mr20429066pbc.100.1440822262512; Fri, 28 Aug 2015 21:24:22 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ue3si13334131pab.213.2015.08.28.21.24.20; Fri, 28 Aug 2015 21:24:22 -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 S1752683AbbH2EYF (ORCPT + 28 others); Sat, 29 Aug 2015 00:24:05 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:39818 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634AbbH2EYC (ORCPT ); Sat, 29 Aug 2015 00:24:02 -0400 Received: from 172.24.1.47 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.47]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CTY94473; Sat, 29 Aug 2015 12:23:18 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.235.1; Sat, 29 Aug 2015 12:23:07 +0800 From: Wang Nan To: , , CC: , , , Wang Nan , Brendan Gregg , Daniel Borkmann , David Ahern , "He Kuang" , Jiri Olsa , Kaixu Xia , Masami Hiramatsu , Namhyung Kim , Paul Mackerras , Peter Zijlstra Subject: [PATCH 15/31] perf record: Add clang options for compiling BPF scripts Date: Sat, 29 Aug 2015 04:21:49 +0000 Message-ID: <1440822125-52691-16-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1440822125-52691-1-git-send-email-wangnan0@huawei.com> References: <1440822125-52691-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.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/1436445342-1402-28-git-send-email-wangnan0@huawei.com --- 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 fd56a5b..212718c 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -30,6 +30,7 @@ #include "util/auxtrace.h" #include "util/parse-branch-options.h" #include "util/bpf-loader.h" +#include "util/llvm-utils.h" #include #include @@ -1094,6 +1095,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() };