diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-11-18 04:55:57 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-27 12:58:36 -0500 |
commit | 69e7e5b02bc6a9e5cf4a54911b27ca133cc1f99f (patch) | |
tree | 3e52f896d030e10dd817d6f212c43be5d70e3bfc | |
parent | 167faf32b07fc47637048fbcbdfcf4a89481686d (diff) |
perf record: Default -t option to no inheritance
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>
-rw-r--r-- | tools/perf/Documentation/perf-record.txt | 2 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 8 | ||||
-rw-r--r-- | 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 | |||
57 | -t:: | 57 | -t:: |
58 | --tid=:: | 58 | --tid=:: |
59 | Record events on existing thread ID (comma separated list). | 59 | Record events on existing thread ID (comma separated list). |
60 | This option also disables inheritance by default. Enable it by adding | ||
61 | --inherit. | ||
60 | 62 | ||
61 | -u:: | 63 | -u:: |
62 | --uid=:: | 64 | --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[] = { | |||
843 | OPT_U64('c', "count", &record.opts.user_interval, "event period to sample"), | 843 | OPT_U64('c', "count", &record.opts.user_interval, "event period to sample"), |
844 | OPT_STRING('o', "output", &record.file.path, "file", | 844 | OPT_STRING('o', "output", &record.file.path, "file", |
845 | "output file name"), | 845 | "output file name"), |
846 | OPT_BOOLEAN('i', "no-inherit", &record.opts.no_inherit, | 846 | OPT_BOOLEAN_SET('i', "no-inherit", &record.opts.no_inherit, |
847 | "child tasks do not inherit counters"), | 847 | &record.opts.no_inherit_set, |
848 | "child tasks do not inherit counters"), | ||
848 | OPT_UINTEGER('F', "freq", &record.opts.user_freq, "profile at this frequency"), | 849 | OPT_UINTEGER('F', "freq", &record.opts.user_freq, "profile at this frequency"), |
849 | OPT_CALLBACK('m', "mmap-pages", &record.opts.mmap_pages, "pages", | 850 | OPT_CALLBACK('m', "mmap-pages", &record.opts.mmap_pages, "pages", |
850 | "number of mmap data pages", | 851 | "number of mmap data pages", |
@@ -939,6 +940,9 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused) | |||
939 | goto out_symbol_exit; | 940 | goto out_symbol_exit; |
940 | } | 941 | } |
941 | 942 | ||
943 | if (rec->opts.target.tid && !rec->opts.no_inherit_set) | ||
944 | rec->opts.no_inherit = true; | ||
945 | |||
942 | err = target__validate(&rec->opts.target); | 946 | err = target__validate(&rec->opts.target); |
943 | if (err) { | 947 | if (err) { |
944 | target__strerror(&rec->opts.target, err, errbuf, BUFSIZ); | 948 | 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 { | |||
254 | bool inherit_stat; | 254 | bool inherit_stat; |
255 | bool no_delay; | 255 | bool no_delay; |
256 | bool no_inherit; | 256 | bool no_inherit; |
257 | bool no_inherit_set; | ||
257 | bool no_samples; | 258 | bool no_samples; |
258 | bool raw_samples; | 259 | bool raw_samples; |
259 | bool sample_address; | 260 | bool sample_address; |