Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396341

Re: [PATCH 2/8] perf script: Add options for custom vdso name

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/8] perf script: Add options for custom vdso name
Date 2016-05-07 20:20 +0200
Message-ID <rweZz-6wi-5@gated-at.bofh.it> (permalink)
References <rvJVM-2eU-17@gated-at.bofh.it> <rvJVN-2eU-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, May 06, 2016 at 08:59:08AM +0000, He Kuang wrote:
> 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 <hekuang@huawei.com>
> ---
>  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;
> +	}
>  	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,

could you please elaborate on how this one gets set?
don't we already store it under .debug?

also it seems fairly vdso specific, we shouldn't call it DSO_CUSTOM

thanks,
jirka

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] Add support for remote unwind He Kuang <hekuang@huawei.com> - 2016-05-06 11:10 +0200
  [PATCH 7/8] perf callchain: Support x86 target platform He Kuang <hekuang@huawei.com> - 2016-05-06 11:10 +0200
  [PATCH 2/8] perf script: Add options for custom vdso name He Kuang <hekuang@huawei.com> - 2016-05-06 11:10 +0200
    Re: [PATCH 2/8] perf script: Add options for custom vdso name Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-05-06 13:50 +0200
    Re: [PATCH 2/8] perf script: Add options for custom vdso name Jiri Olsa <jolsa@redhat.com> - 2016-05-07 20:20 +0200
  Re: [PATCH 0/8] Add support for remote unwind Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-05-06 14:00 +0200

csiph-web