Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752682AbbH2EYF (ORCPT ); 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 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 Content-Type: text/plain X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2166 Lines: 58 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() }; -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/