Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934212AbbKSOEH (ORCPT ); Thu, 19 Nov 2015 09:04:07 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:43312 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755393AbbKSOEE (ORCPT ); Thu, 19 Nov 2015 09:04:04 -0500 From: Wang Nan To: CC: , , , He Kuang , Wang Nan , "Alexei Starovoitov" , Arnaldo Carvalho de Melo , Masami Hiramatsu , Namhyung Kim Subject: [PATCH 2/2] perf record: Support custom vmlinux path Date: Thu, 19 Nov 2015 14:03:13 +0000 Message-ID: <1447941793-118639-3-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1447941793-118639-1-git-send-email-wangnan0@huawei.com> References: <20151117124224.GH22729@kernel.org> <1447941793-118639-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 X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.564DD6B4.024E,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: c961c82253b35aab88eb1ec7a8ca561d Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3066 Lines: 86 From: He Kuang Make perf-record command support --vmlinux option if BPF_PROLOGUE is on. 'perf record' needs vmlinux as the source of DWARF info to generate prologue for BPF programs, so path of vmlinux should be specified. Short name 'k' has been taken by 'clockid'. This patch skips the short option name and use '--vmlinux' for vmlinux path. Documentation is also updated. Signed-off-by: He Kuang Signed-off-by: Wang Nan Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Zefan Li Cc: pi3orama@163.com --- tools/perf/Documentation/perf-record.txt | 10 ++++++++-- tools/perf/builtin-record.c | 11 +++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index e630a7d..8d032f4 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -314,11 +314,17 @@ This option sets the time out limit. The default value is 500 ms. Record context switch events i.e. events of type PERF_RECORD_SWITCH or PERF_RECORD_SWITCH_CPU_WIDE. ---clang-path:: +--clang-path=PATH:: Path to clang binary to use for compiling BPF scriptlets. +(enabled when BPF support is on) ---clang-opt:: +--clang-opt=OPTIONS:: Options passed to clang when compiling BPF scriptlets. +(enabled when BPF support is on) + +--vmlinux=PATH:: +Specify vmlinux path which has debuginfo. +(enabled when BPF prologue is on) SEE ALSO -------- diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index b02d1ee..b046fc3 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1118,6 +1118,14 @@ struct option __record_options[] = { "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"), +#ifdef HAVE_BPF_PROLOGUE + OPT_STRING(0, "vmlinux", &symbol_conf.vmlinux_name, + "file", "vmlinux pathname"), +#else + OPT_NOTBUILT(0, "vmlinux", "file", + "vmlinux pathname", + "BPF prologue not built-in", true), +#endif #else OPT_NOTBUILT(0, "clang-path", "clang path", "clang binary to use for compiling BPF scriptlets", @@ -1125,6 +1133,9 @@ struct option __record_options[] = { OPT_NOTBUILT(0, "clang-opt", "clang options", "options passed to clang when compiling BPF scriptlets", "disabled by NO_LIBBPF", true), + OPT_NOTBUILT(0, "vmlinux", "file", + "vmlinux pathname", + "disabled by NO_LIBBPF", true), #endif OPT_END() }; -- 1.8.3.4 -- 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/