提交 a0c0a4ac 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

perf top: Add --namespaces option

Since 'perf record' already have this option, let's have it for 'perf top'
as well.
Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Krister Johansen <kjlx@templeofstupid.com>
Link: http://lkml.kernel.org/r/20190522053250.207156-4-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 a9a187a7
...@@ -262,6 +262,11 @@ Default is to monitor all CPUS. ...@@ -262,6 +262,11 @@ Default is to monitor all CPUS.
The number of threads to run when synthesizing events for existing processes. The number of threads to run when synthesizing events for existing processes.
By default, the number of threads equals to the number of online CPUs. By default, the number of threads equals to the number of online CPUs.
--namespaces::
Record events of type PERF_RECORD_NAMESPACES and display it with the
'cgroup_id' sort key.
INTERACTIVE PROMPTING KEYS INTERACTIVE PROMPTING KEYS
-------------------------- --------------------------
......
...@@ -1208,6 +1208,9 @@ static int __cmd_top(struct perf_top *top) ...@@ -1208,6 +1208,9 @@ static int __cmd_top(struct perf_top *top)
init_process_thread(top); init_process_thread(top);
if (opts->record_namespaces)
top->tool.namespace_events = true;
ret = perf_event__synthesize_bpf_events(top->session, perf_event__process, ret = perf_event__synthesize_bpf_events(top->session, perf_event__process,
&top->session->machines.host, &top->session->machines.host,
&top->record_opts); &top->record_opts);
...@@ -1500,6 +1503,8 @@ int cmd_top(int argc, const char **argv) ...@@ -1500,6 +1503,8 @@ int cmd_top(int argc, const char **argv)
OPT_BOOLEAN(0, "force", &symbol_conf.force, "don't complain, do it"), OPT_BOOLEAN(0, "force", &symbol_conf.force, "don't complain, do it"),
OPT_UINTEGER(0, "num-thread-synthesize", &top.nr_threads_synthesize, OPT_UINTEGER(0, "num-thread-synthesize", &top.nr_threads_synthesize,
"number of thread to run event synthesize"), "number of thread to run event synthesize"),
OPT_BOOLEAN(0, "namespaces", &opts->record_namespaces,
"Record namespaces events"),
OPT_END() OPT_END()
}; };
struct perf_evlist *sb_evlist = NULL; struct perf_evlist *sb_evlist = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册