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


Groups > linux.kernel > #1341951

Re: [PATCH 04/15] perf mem: Add -u/-k options

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 04/15] perf mem: Add -u/-k options
Date 2016-02-24 14:20 +0100
Message-ID <r5Hwe-543-7@gated-at.bofh.it> (permalink)
References <r5DiV-1S4-3@gated-at.bofh.it> <r5DsC-1VT-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Em Wed, Feb 24, 2016 at 09:46:45AM +0100, Jiri Olsa escreveu:
> Add -u/-k (--all-user/--all-kernel) options to use
> the perf record --all-user/--all-kernel options.

Missing documentation update. -u/-k usage is ok, should be the same
accross all tools, have to check that... Actually make that -U and -K,
'perf top' needs fixing in making -U mean --hide_kernel_symbols , will do.

- Arnaldo
 
> Link: http://lkml.kernel.org/n/tip-adxn5c48oe0gmjrjmq6we27q@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/perf/builtin-mem.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
> index 9da09e058f4b..8a31b3f634d9 100644
> --- a/tools/perf/builtin-mem.c
> +++ b/tools/perf/builtin-mem.c
> @@ -62,6 +62,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
>  	int rec_argc, i = 0, j;
>  	const char **rec_argv;
>  	int ret;
> +	bool all_user = false, all_kernel = false;
>  	struct option options[] = {
>  	OPT_CALLBACK('e', "event", &mem, "event",
>  		     "event selector. use 'perf mem record -e list' to list available events",
> @@ -69,13 +70,15 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
>  	OPT_UINTEGER('l', "ldlat", &perf_mem_events__loads_ldlat, "mem-loads latency"),
>  	OPT_INCR('v', "verbose", &verbose,
>  		 "be more verbose (show counter open errors, etc)"),
> +	OPT_BOOLEAN('u', "--all-user", &all_user, "collect only user level data"),
> +	OPT_BOOLEAN('k', "--all-kernel", &all_kernel, "collect only kernel level data"),
>  	OPT_END()
>  	};
>  
>  	argc = parse_options(argc, argv, options, record_mem_usage,
>  			     PARSE_OPT_STOP_AT_NON_OPTION);
>  
> -	rec_argc = argc + 7; /* max number of arguments */
> +	rec_argc = argc + 9; /* max number of arguments */
>  	rec_argv = calloc(rec_argc + 1, sizeof(char *));
>  	if (!rec_argv)
>  		return -1;
> @@ -104,6 +107,12 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
>  		rec_argv[i++] = perf_mem_events__name(j);
>  	};
>  
> +	if (all_user)
> +		rec_argv[i++] = "--all-user";
> +
> +	if (all_kernel)
> +		rec_argv[i++] = "--all-kernel";
> +
>  	for (j = 0; j < argc; j++, i++)
>  		rec_argv[i] = argv[j];
>  
> -- 
> 2.4.3

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


Thread

[PATCHv2 00/15] perf tools: Several memory events updates Jiri Olsa <jolsa@kernel.org> - 2016-02-24 09:50 +0100
  [PATCH 01/15] perf mem: Check for memory events support Jiri Olsa <jolsa@kernel.org> - 2016-02-24 09:50 +0100
    [tip:perf/core] perf mem record: Check for memory events support tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-02-25 08:40 +0100
  [PATCH 13/15] perf script: Display data_src values Jiri Olsa <jolsa@kernel.org> - 2016-02-24 09:50 +0100
    Re: [PATCH 13/15] perf script: Display data_src values Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-24 14:40 +0100
      Re: [PATCH 13/15] perf script: Display data_src values Jiri Olsa <jolsa@redhat.com> - 2016-02-24 20:20 +0100
    [tip:perf/core] perf script: Display data_src values tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-02-25 08:50 +0100
  [PATCH 07/15] perf tools: Introduce perf_mem__snp_scnprintf function Jiri Olsa <jolsa@kernel.org> - 2016-02-24 09:50 +0100
    [tip:perf/core] perf tools: Introduce perf_mem__snp_scnprintf  function tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-02-25 08:40 +0100
  [PATCH 15/15] perf mem: Add Intel DATALA memory events Jiri Olsa <jolsa@kernel.org> - 2016-02-24 09:50 +0100
  [PATCH 04/15] perf mem: Add -u/-k options Jiri Olsa <jolsa@kernel.org> - 2016-02-24 10:00 +0100
    Re: [PATCH 04/15] perf mem: Add -u/-k options Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-24 14:20 +0100
      Re: [PATCH 04/15] perf mem: Add -u/-k options Jiri Olsa <jolsa@redhat.com> - 2016-02-24 20:20 +0100

csiph-web