From patchwork Sun Sep 6 07:13: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: 53189 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 27D0B22B05 for ; Sun, 6 Sep 2015 07:19:36 +0000 (UTC) Received: by laeb10 with SMTP id b10sf19033765lae.1 for ; Sun, 06 Sep 2015 00:19:35 -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=1SO5eo0yCM6/En+YsP7GTA63rMiuqXT7zy5ZBLqHFPI=; b=WfYPFnG+6cEpwIhphM59U7HAKsVkjNVtEjyletoZO5vTUi20CS+3LkNXx+zJUmu3QY OuUPbthclqmF4CAonEbdYwQBEtaUkmopsH5Bmkuhzul2TU1jNOx2kqszl8H94Ec8EKzV yqBYx6zpzotdvlgaBqeRXdWxwEIuL5cnKdCg0vdi/H1I9boAzSG+d/ooyESDJq3aaVR+ NFaZ72312Zglmebs8H1VrdM02fafge6uFsWFi6XrBDTH609O9Y/blMCWz0YANvaZsVRU KnMB528E73W7B7/QpMiZoxTcAXsUcngIqcb+ZlHf6heGr4Y3/Hujga9nVnVdU8SYbXiK Z7ug== X-Gm-Message-State: ALoCoQnskk0jFGZocYXqF/7Gp1tsrlR4xnHRioW2PjDr16Mp4ZxQoH3Ba8jAiRti/0K6imDPAmoq X-Received: by 10.180.9.104 with SMTP id y8mr3408936wia.7.1441523975170; Sun, 06 Sep 2015 00:19:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.234 with SMTP id jf10ls474938lac.60.gmail; Sun, 06 Sep 2015 00:19:34 -0700 (PDT) X-Received: by 10.112.130.3 with SMTP id oa3mr11689895lbb.13.1441523974848; Sun, 06 Sep 2015 00:19:34 -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 am8si7218044lac.135.2015.09.06.00.19.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Sep 2015 00:19:34 -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 lbpo4 with SMTP id o4so27015177lbp.2 for ; Sun, 06 Sep 2015 00:19:34 -0700 (PDT) X-Received: by 10.112.51.142 with SMTP id k14mr1866801lbo.76.1441523974727; Sun, 06 Sep 2015 00:19:34 -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.164.42 with SMTP id yn10csp844880lbb; Sun, 6 Sep 2015 00:19:33 -0700 (PDT) X-Received: by 10.66.142.166 with SMTP id rx6mr29945448pab.25.1441523973580; Sun, 06 Sep 2015 00:19:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si13760093pdr.158.2015.09.06.00.19.32; Sun, 06 Sep 2015 00:19:33 -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 S1750964AbbIFHT2 (ORCPT + 28 others); Sun, 6 Sep 2015 03:19:28 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:7315 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751369AbbIFHOn (ORCPT ); Sun, 6 Sep 2015 03:14:43 -0400 Received: from 172.24.1.48 (EHLO SZXEML423-HUB.china.huawei.com) ([172.24.1.48]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUK94049; Sun, 06 Sep 2015 15:14:15 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by SZXEML423-HUB.china.huawei.com (10.82.67.154) with Microsoft SMTP Server id 14.3.235.1; Sun, 6 Sep 2015 15:14:05 +0800 From: Wang Nan To: , , , CC: , , , , , , , , , , , Subject: [PATCH 12/27] perf record: Add clang options for compiling BPF scripts Date: Sun, 6 Sep 2015 07:13:28 +0000 Message-ID: <1441523623-152703-13-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1441523623-152703-1-git-send-email-wangnan0@huawei.com> References: <1441523623-152703-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: , 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 f99d580..11e7d63 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -32,6 +32,7 @@ #include "util/parse-branch-options.h" #include "util/parse-regs-options.h" #include "util/bpf-loader.h" +#include "util/llvm-utils.h" #include #include @@ -1097,6 +1098,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() };