All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
	Andi Kleen <ak@linux.intel.com>, David Ahern <dsahern@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Stephane Eranian <eranian@google.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 01/11] perf mem: Add -U/-K (--all-user/--all-kernel) options
Date: Tue, 29 Mar 2016 20:41:19 -0300	[thread overview]
Message-ID: <1459294889-12148-2-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1459294889-12148-1-git-send-email-acme@kernel.org>

From: Jiri Olsa <jolsa@kernel.org>

Add -U/-K (--all-user/--all-kernel) options to use the perf record
--all-user/--all-kernel options.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1458823940-24583-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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 43310d8661fe..1d6092c460dd 100644
--- a/tools/perf/Documentation/perf-mem.txt
+++ b/tools/perf/Documentation/perf-mem.txt
@@ -48,6 +48,14 @@ OPTIONS
 	option can be passed in record mode. It will be interpreted the same way as perf
 	record.
 
+-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 85db3be4b3cb..1dc140c5481d 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -62,19 +62,22 @@ 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",
 		     parse_record_events),
 	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;
@@ -103,6 +106,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.5.5

  reply	other threads:[~2016-03-29 23:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 23:41 [GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-03-29 23:41 ` Arnaldo Carvalho de Melo [this message]
2016-03-29 23:41 ` [PATCH 02/11] perf tools: Make hists__collapse_insert_entry static Arnaldo Carvalho de Melo
2016-03-29 23:41 ` [PATCH 03/11] perf tools: Make -f/--force option documentation consistent across tools Arnaldo Carvalho de Melo
2016-03-29 23:41 ` [PATCH 04/11] perf tests: Add test to check for event times Arnaldo Carvalho de Melo
2016-03-29 23:41 ` [PATCH 05/11] perf config: Remove duplicated set_buildid_dir calls Arnaldo Carvalho de Melo
2016-03-29 23:41 ` [PATCH 06/11] perf config: Rework buildid_dir_command_config to perf_buildid_config Arnaldo Carvalho de Melo
2016-03-29 23:41 ` [PATCH 07/11] perf config: Rename 'v' to 'home' in set_buildid_dir() Arnaldo Carvalho de Melo
2016-03-29 23:41 ` [PATCH 08/11] perf script perl: Perl scripts now get a backtrace, like the python ones Arnaldo Carvalho de Melo
2016-03-29 23:41 ` [PATCH 09/11] perf tools: Add support for skipping itrace instructions Arnaldo Carvalho de Melo
2016-03-29 23:41 ` [PATCH 10/11] perf tools: Add probing for udev86 library Arnaldo Carvalho de Melo
2016-03-30 10:43   ` Ingo Molnar
2016-03-30 13:36     ` Arnaldo Carvalho de Melo
2016-03-30 13:52       ` Ingo Molnar
2016-03-30 14:10         ` Arnaldo Carvalho de Melo
2016-03-30 14:47           ` Arnaldo Carvalho de Melo
2016-03-31  6:34             ` Ingo Molnar
2016-03-30 15:08         ` Andi Kleen
2016-03-31  6:49           ` Ingo Molnar
2016-03-30 14:42     ` Andi Kleen
2016-03-29 23:41 ` [PATCH 11/11] perf script: Add support for printing assembler 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=1459294889-12148-2-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.