]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
perf top: Allow disabling the overwrite mode
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 26 Oct 2018 18:55:23 +0000 (15:55 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 30 Oct 2018 14:46:23 +0000 (11:46 -0300)
In ebebbf082357 ("perf top: Switch default mode to overwrite mode") we
forgot to leave a way to disable that new default, add a --overwrite
option that can be disabled using --no-overwrite, since the code already
in such a way that we can readily disable this mode.

This is useful when investigating bugs with this mode like the recent
report from David Miller where lots of unknown symbols appear due to
disabling the events while processing them which disables all record
types, not just PERF_RECORD_SAMPLE, which makes it impossible to resolve
maps when we lose PERF_RECORD_MMAP records.

This can be easily seen while building a kernel, when there are lots of
short lived processes.

Reported-by: David Miller <davem@davemloft.net>
Acked-by: Kan Liang <kan.liang@intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: ebebbf082357 ("perf top: Switch default mode to overwrite mode")
Link: https://lkml.kernel.org/n/tip-oqgsz2bq4kgrnnajrafcdhie@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-top.txt
tools/perf/builtin-top.c

index 114fda12aa490089c16802282ed598f51303bd10..d4be6061fe1c1f67a991fd8ebccb33ef5da49265 100644 (file)
@@ -242,6 +242,11 @@ Default is to monitor all CPUS.
 --hierarchy::
        Enable hierarchy output.
 
+--overwrite::
+       This is the default, but for investigating problems with it or any other strange
+       behaviour like lots of unknown samples, we may want to disable this mode by using
+       --no-overwrite.
+
 --force::
        Don't do ownership validation.
 
index d21d8751e74910db9639f0b3c450abf42eb223ab..214fad747b041068b53712886bc37ec80eb1dd8b 100644 (file)
@@ -1372,6 +1372,8 @@ int cmd_top(int argc, const char **argv)
                    "Show raw trace event output (do not use print fmt or plugins)"),
        OPT_BOOLEAN(0, "hierarchy", &symbol_conf.report_hierarchy,
                    "Show entries in a hierarchy"),
+       OPT_BOOLEAN(0, "overwrite", &top.record_opts.overwrite,
+                   "Use a backward ring buffer, default: yes"),
        OPT_BOOLEAN(0, "force", &symbol_conf.force, "don't complain, do it"),
        OPT_UINTEGER(0, "num-thread-synthesize", &top.nr_threads_synthesize,
                        "number of thread to run event synthesize"),