linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@redhat.com>,
	Mike Galbraith <efault@gmx.de>, Namhyung Kim <namhyung@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Stephane Eranian <eranian@google.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 13/34] perf record: Default -t option to no inheritance
Date: Wed, 27 Nov 2013 17:16:13 -0300	[thread overview]
Message-ID: <1385583394-3703-14-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1385583394-3703-1-git-send-email-acme@infradead.org>

From: Adrian Hunter <adrian.hunter@intel.com>

The change to per-cpu mmaps causes the -p, -t and -u options now to have
inheritance enabled by default.  Change that back to no inheritance but
for the -t option only.

Requested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1384768557-23331-5-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-record.txt | 2 ++
 tools/perf/builtin-record.c              | 8 ++++++--
 tools/perf/perf.h                        | 1 +
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index 6ac867e7667f..c407897f0435 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -57,6 +57,8 @@ OPTIONS
 -t::
 --tid=::
         Record events on existing thread ID (comma separated list).
+        This option also disables inheritance by default.  Enable it by adding
+        --inherit.
 
 -u::
 --uid=::
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index f5b18b8fe8c9..65615a8bc25e 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -843,8 +843,9 @@ const struct option record_options[] = {
 	OPT_U64('c', "count", &record.opts.user_interval, "event period to sample"),
 	OPT_STRING('o', "output", &record.file.path, "file",
 		    "output file name"),
-	OPT_BOOLEAN('i', "no-inherit", &record.opts.no_inherit,
-		    "child tasks do not inherit counters"),
+	OPT_BOOLEAN_SET('i', "no-inherit", &record.opts.no_inherit,
+			&record.opts.no_inherit_set,
+			"child tasks do not inherit counters"),
 	OPT_UINTEGER('F', "freq", &record.opts.user_freq, "profile at this frequency"),
 	OPT_CALLBACK('m', "mmap-pages", &record.opts.mmap_pages, "pages",
 		     "number of mmap data pages",
@@ -939,6 +940,9 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
 		goto out_symbol_exit;
 	}
 
+	if (rec->opts.target.tid && !rec->opts.no_inherit_set)
+		rec->opts.no_inherit = true;
+
 	err = target__validate(&rec->opts.target);
 	if (err) {
 		target__strerror(&rec->opts.target, err, errbuf, BUFSIZ);
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index b079304bd53d..b23fed527514 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -254,6 +254,7 @@ struct perf_record_opts {
 	bool	     inherit_stat;
 	bool	     no_delay;
 	bool	     no_inherit;
+	bool	     no_inherit_set;
 	bool	     no_samples;
 	bool	     raw_samples;
 	bool	     sample_address;
-- 
1.8.1.4


  parent reply	other threads:[~2013-11-27 20:25 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27 20:16 [PATCH 00/34] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 01/34] tools lib traceevent: Use helper trace-seq in print functions like kernel does Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 02/34] perf trace: Remove thread summary coloring Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 03/34] perf top: Make -g refer to callchains Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 04/34] perf completion: Introduce a layer of indirection Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 05/34] perf completion: Factor out compgen stuff Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 06/34] perf completion: Factor out call to __ltrim_colon_completions Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 07/34] perf completion: Introduce zsh support Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 08/34] perf completion: Rename file to reflect " Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 09/34] perf script: Move evname print code to process_event() Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 10/34] perf record: Make per-cpu mmaps the default Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 11/34] perf tools: Allow '--inherit' as the negation of '--no-inherit' Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 12/34] perf tools: Add option macro OPT_BOOLEAN_SET Arnaldo Carvalho de Melo
2013-11-27 20:16 ` Arnaldo Carvalho de Melo [this message]
2013-11-27 20:16 ` [PATCH 14/34] perf timechart: Always try to print at least 15 tasks Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 15/34] perf timechart: Add option to limit number of tasks Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 16/34] perf timechart: Use proc_num to implement --power-only Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 17/34] perf timechart: Add support for displaying only tasks related data Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 18/34] perf timechart: Group figures and add title with details Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 19/34] perf timechart: Add support for -P and -T in timechart recording Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 20/34] perf timechart: Add backtrace support Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 21/34] perf evsel: Skip ignored symbols while printing callchain Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 22/34] perf symbols: Move idle syms check from top to generic function Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 23/34] perf thread: Move comm_list check into function Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 24/34] perf tools: Export setup_list Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 25/34] perf script: Print callchains and symbols if they exist Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 26/34] perf script: Print comm, fork and exit events also Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 27/34] perf script: Print mmap[2] " Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 28/34] perf symbols: Fix not finding kcore in buildid cache Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 29/34] perf timechart: dynamically determine event fields offset Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 30/34] perf timechart: Remove some needless struct forward declarations Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 31/34] perf timechart: Remove misplaced __maybe_unused Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 32/34] perf tools: Fix tags/TAGS targets rebuilding Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 33/34] perf tools: Add per-feature check flags Arnaldo Carvalho de Melo
2013-11-27 20:16 ` [PATCH 34/34] perf tools unwinding: Use the " Arnaldo Carvalho de Melo
2013-11-27 22:43   ` Jiri Olsa
2013-11-28  9:58     ` Jiri Olsa
2013-11-28 12:56       ` Arnaldo Carvalho de Melo
2013-11-28 13:46         ` Arnaldo Carvalho de Melo
2013-11-28 20:02           ` Jean Pihet
2013-11-29 15:45             ` Jiri Olsa
2013-12-03 16:15               ` Jean Pihet
2013-12-07 10:17                 ` Jean Pihet

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=1385583394-3703-14-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).