aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-10-29 08:47:00 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-10-31 08:57:31 -0400
commit218d61110f69632974034b6e27686ce482a1c455 (patch)
tree594ef38e29a1410cf63e3b5c30f5e5bc74030ada /tools
parent4e303fbe2d95806c875f5ebfcb3d980e20b4bd83 (diff)
perf top: Do not use overwrite mode by default
Enabling --overwrite mode allows us to to use just the most recent records, which helps in high core count machines such as Knights Landing/Mill, but right now is being disabled by default as the pausing used in this technique is leading to loss of metadata events such as PERF_RECORD_MMAP which makes 'perf top' unable to resolve samples, leading to lots of unknown samples appearing on the UI. Enabling this may be useful if you are in such machines and profiling a workload that doesn't creates short lived threads and/or doesn't uses many executable mmap operations. Work is being planed to solve this situation, till then, this will remain disabled by default. Reported-by: David Miller <davem@davemloft.net> Acked-by: Kan Liang <kan.liang@intel.com> Link: https://lkml.kernel.org/r/4f84468f-37d9-cf1b-12c1-514ef74b6a48@linux.intel.com Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Fixes: ebebbf082357 ("perf top: Switch default mode to overwrite mode") Link: https://lkml.kernel.org/n/tip-ehvf77vi1si9409r7p4wx788@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/Documentation/perf-top.txt11
-rw-r--r--tools/perf/builtin-top.c11
2 files changed, 17 insertions, 5 deletions
diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
index d4be6061fe1c..808b664343c9 100644
--- a/tools/perf/Documentation/perf-top.txt
+++ b/tools/perf/Documentation/perf-top.txt
@@ -243,9 +243,14 @@ Default is to monitor all CPUS.
243 Enable hierarchy output. 243 Enable hierarchy output.
244 244
245--overwrite:: 245--overwrite::
246 This is the default, but for investigating problems with it or any other strange 246 Enable this to use just the most recent records, which helps in high core count
247 behaviour like lots of unknown samples, we may want to disable this mode by using 247 machines such as Knights Landing/Mill, but right now is disabled by default as
248 --no-overwrite. 248 the pausing used in this technique is leading to loss of metadata events such
249 as PERF_RECORD_MMAP which makes 'perf top' unable to resolve samples, leading
250 to lots of unknown samples appearing on the UI. Enable this if you are in such
251 machines and profiling a workload that doesn't creates short lived threads and/or
252 doesn't uses many executable mmap operations. Work is being planed to solve
253 this situation, till then, this will remain disabled by default.
249 254
250--force:: 255--force::
251 Don't do ownership validation. 256 Don't do ownership validation.
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 214fad747b04..8e29e0cc8626 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1257,7 +1257,14 @@ int cmd_top(int argc, const char **argv)
1257 .uses_mmap = true, 1257 .uses_mmap = true,
1258 }, 1258 },
1259 .proc_map_timeout = 500, 1259 .proc_map_timeout = 500,
1260 .overwrite = 1, 1260 /*
1261 * FIXME: This will lose PERF_RECORD_MMAP and other metadata
1262 * when we pause, fix that and reenable. Probably using a
1263 * separate evlist with a dummy event, i.e. a non-overwrite
1264 * ring buffer just for metadata events, while PERF_RECORD_SAMPLE
1265 * stays in overwrite mode. -acme
1266 * */
1267 .overwrite = 0,
1261 }, 1268 },
1262 .max_stack = sysctl__max_stack(), 1269 .max_stack = sysctl__max_stack(),
1263 .annotation_opts = annotation__default_options, 1270 .annotation_opts = annotation__default_options,
@@ -1373,7 +1380,7 @@ int cmd_top(int argc, const char **argv)
1373 OPT_BOOLEAN(0, "hierarchy", &symbol_conf.report_hierarchy, 1380 OPT_BOOLEAN(0, "hierarchy", &symbol_conf.report_hierarchy,
1374 "Show entries in a hierarchy"), 1381 "Show entries in a hierarchy"),
1375 OPT_BOOLEAN(0, "overwrite", &top.record_opts.overwrite, 1382 OPT_BOOLEAN(0, "overwrite", &top.record_opts.overwrite,
1376 "Use a backward ring buffer, default: yes"), 1383 "Use a backward ring buffer, default: no"),
1377 OPT_BOOLEAN(0, "force", &symbol_conf.force, "don't complain, do it"), 1384 OPT_BOOLEAN(0, "force", &symbol_conf.force, "don't complain, do it"),
1378 OPT_UINTEGER(0, "num-thread-synthesize", &top.nr_threads_synthesize, 1385 OPT_UINTEGER(0, "num-thread-synthesize", &top.nr_threads_synthesize,
1379 "number of thread to run event synthesize"), 1386 "number of thread to run event synthesize"),