From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Stephane Eranian <eranian@google.com>,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 2/6] perf mem: Add -U/-K (--all-user/--all-kernel) options
Date: Thu, 24 Mar 2016 12:58:25 -0300 [thread overview]
Message-ID: <20160324155825.GB32162@kernel.org> (raw)
In-Reply-To: <1458823940-24583-3-git-send-email-jolsa@kernel.org>
Em Thu, Mar 24, 2016 at 01:52:16PM +0100, Jiri Olsa escreveu:
> Add -U/-K (--all-user/--all-kernel) options to use
> the perf record --all-user/--all-kernel options.
Applying this after fixing up the clash due to the first patch not being
merged so far.
> Link: http://lkml.kernel.org/n/tip-adxn5c48oe0gmjrjmq6we27q@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
> tools/perf/Documentation/perf-mem.txt | 8 ++++++++
> tools/perf/builtin-mem.c | 11 ++++++++++-
> 2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/Documentation/perf-mem.txt b/tools/perf/Documentation/perf-mem.txt
> index 6676d2784733..f8e23f50ce59 100644
> --- a/tools/perf/Documentation/perf-mem.txt
> +++ b/tools/perf/Documentation/perf-mem.txt
> @@ -51,6 +51,14 @@ OPTIONS
> --ldload::
> Specify desired latency for loads event.
>
> +-K::
> +--all-kernel::
> + Configure all used events to run in kernel space.
> +
> +-U::
> +--all-user::
> + Configure all used events to run in user space.
> +
> SEE ALSO
> --------
> linkperf:perf-record[1], linkperf:perf-report[1]
> diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
> index bf0bfca5be20..5dad76e1c8df 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(0, "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
next prev parent reply other threads:[~2016-03-24 15:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 12:52 [PATCH 0/6][perf/core] perf tools: Fixes Jiri Olsa
2016-03-24 12:52 ` [PATCH 1/6] perf mem: Add --ldlat option Jiri Olsa
2016-03-24 15:57 ` Arnaldo Carvalho de Melo
2016-03-26 16:06 ` Jiri Olsa
2016-04-07 13:58 ` Jiri Olsa
2016-03-24 12:52 ` [PATCH 2/6] perf mem: Add -U/-K (--all-user/--all-kernel) options Jiri Olsa
2016-03-24 15:58 ` Arnaldo Carvalho de Melo [this message]
2016-03-31 6:51 ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-03-24 12:52 ` [PATCH 3/6] perf tools: Make hists__collapse_insert_entry static Jiri Olsa
2016-03-31 6:52 ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-03-24 12:52 ` [PATCH 4/6] perf tools: Introduce trim function Jiri Olsa
2016-03-24 12:52 ` [PATCH 5/6] perf tools: Unify -f/--force option documentation Jiri Olsa
2016-03-31 6:52 ` [tip:perf/core] perf tools: Make -f/--force option documentation consistent across tools tip-bot for Jiri Olsa
2016-03-24 12:52 ` [PATCH 6/6] perf tests: Add test to check for event times Jiri Olsa
2016-03-31 6:52 ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-03-24 16:06 ` [PATCH 0/6][perf/core] perf tools: Fixes Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160324155825.GB32162@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=ak@linux.intel.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox