From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758561AbcEFLtu (ORCPT ); Fri, 6 May 2016 07:49:50 -0400 Received: from mail.kernel.org ([198.145.29.136]:40751 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758536AbcEFLts (ORCPT ); Fri, 6 May 2016 07:49:48 -0400 Date: Fri, 6 May 2016 08:49:39 -0300 From: Arnaldo Carvalho de Melo To: He Kuang Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, wangnan0@huawei.com, jpoimboe@redhat.com, ak@linux.intel.com, eranian@google.com, namhyung@kernel.org, adrian.hunter@intel.com, sukadev@linux.vnet.ibm.com, masami.hiramatsu.pt@hitachi.com, tumanova@linux.vnet.ibm.com, kan.liang@intel.com, penberg@kernel.org, dsahern@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/8] perf script: Add options for custom vdso name Message-ID: <20160506114939.GU11069@kernel.org> References: <1462525154-125656-1-git-send-email-hekuang@huawei.com> <1462525154-125656-3-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462525154-125656-3-git-send-email-hekuang@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, May 06, 2016 at 08:59:08AM +0000, He Kuang escreveu: > When unwinding callchain on different machine, vdso info should be > provided so the unwind process won't be interrupted if address fell > into vdso region. > > Signed-off-by: He Kuang > --- > tools/perf/builtin-script.c | 2 ++ > tools/perf/util/dso.c | 7 +++++++ > tools/perf/util/dso.h | 1 + > tools/perf/util/symbol.c | 1 + > tools/perf/util/symbol.h | 1 + > 5 files changed, 12 insertions(+) > > diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c > index 8f6ab2a..c88b547 100644 > --- a/tools/perf/builtin-script.c > +++ b/tools/perf/builtin-script.c > @@ -2001,6 +2001,8 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) > "file", "vmlinux pathname"), > OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, > "file", "kallsyms pathname"), > + OPT_STRING(0, "vdso", &symbol_conf.vdso_name, > + "file", "vdso pathname"), > OPT_BOOLEAN('G', "hide-call-graph", &no_callchain, > "When printing symbols do not display call chain"), > OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", > diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c > index 8e639543..344db10 100644 > --- a/tools/perf/util/dso.c > +++ b/tools/perf/util/dso.c > @@ -21,6 +21,7 @@ char dso__symtab_origin(const struct dso *dso) > [DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO] = 'o', > [DSO_BINARY_TYPE__BUILDID_DEBUGINFO] = 'b', > [DSO_BINARY_TYPE__SYSTEM_PATH_DSO] = 'd', > + [DSO_BINARY_TYPE__SYSTEM_PATH_DSO_CUSTOM] = 'r', > [DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE] = 'K', > [DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP] = 'm', > [DSO_BINARY_TYPE__GUEST_KALLSYMS] = 'g', > @@ -113,6 +114,11 @@ int dso__read_binary_type_filename(const struct dso *dso, > build_id_hex, build_id_hex + 2); > break; > > + case DSO_BINARY_TYPE__SYSTEM_PATH_DSO_CUSTOM: > + { > + snprintf(filename, size, "%s", symbol_conf.vdso_name); > + break; > + } Remove the {}, not needed at all. > case DSO_BINARY_TYPE__VMLINUX: > case DSO_BINARY_TYPE__GUEST_VMLINUX: > case DSO_BINARY_TYPE__SYSTEM_PATH_DSO: > @@ -487,6 +493,7 @@ static void try_to_open_dso(struct dso *dso, struct machine *machine) > enum dso_binary_type binary_type_data[] = { > DSO_BINARY_TYPE__BUILD_ID_CACHE, > DSO_BINARY_TYPE__SYSTEM_PATH_DSO, > + DSO_BINARY_TYPE__SYSTEM_PATH_DSO_CUSTOM, Why do you call it a "DSO_CUSTOM" in some places while in others you call it vdso_name? > DSO_BINARY_TYPE__NOT_FOUND, > }; > int i = 0; > diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h > index 0953280..f55ce5b 100644 > --- a/tools/perf/util/dso.h > +++ b/tools/perf/util/dso.h > @@ -23,6 +23,7 @@ enum dso_binary_type { > DSO_BINARY_TYPE__UBUNTU_DEBUGINFO, > DSO_BINARY_TYPE__BUILDID_DEBUGINFO, > DSO_BINARY_TYPE__SYSTEM_PATH_DSO, > + DSO_BINARY_TYPE__SYSTEM_PATH_DSO_CUSTOM, > DSO_BINARY_TYPE__GUEST_KMODULE, > DSO_BINARY_TYPE__GUEST_KMODULE_COMP, > DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE, > diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c > index e7588dc..93f348f 100644 > --- a/tools/perf/util/symbol.c > +++ b/tools/perf/util/symbol.c > @@ -1359,6 +1359,7 @@ static bool dso__is_compatible_symtab_type(struct dso *dso, bool kmod, > case DSO_BINARY_TYPE__JAVA_JIT: > case DSO_BINARY_TYPE__DEBUGLINK: > case DSO_BINARY_TYPE__SYSTEM_PATH_DSO: > + case DSO_BINARY_TYPE__SYSTEM_PATH_DSO_CUSTOM: > case DSO_BINARY_TYPE__FEDORA_DEBUGINFO: > case DSO_BINARY_TYPE__UBUNTU_DEBUGINFO: > case DSO_BINARY_TYPE__BUILDID_DEBUGINFO: > diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h > index c8b7544..4e6910e 100644 > --- a/tools/perf/util/symbol.h > +++ b/tools/perf/util/symbol.h > @@ -114,6 +114,7 @@ struct symbol_conf { > report_hierarchy; > const char *vmlinux_name, > *kallsyms_name, > + *vdso_name, > *source_prefix, > *field_sep; > const char *default_guest_vmlinux_name, > -- > 1.8.5.2