mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
perf top: Support lookup of symbols in other mount namespaces.
The perf top command needs to unshare its fs from the helper threads in order to successfully setns(2) during its symbol lookup. It also needs to impelement a force flag to ignore ownership of perf-<pid>.map files. Signed-off-by: Krister Johansen <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Brendan Gregg <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas-Mich Richter <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
2b04e0f882
commit
868a832918
2 changed files with 19 additions and 0 deletions
|
|
@ -237,6 +237,10 @@ Default is to monitor all CPUS.
|
|||
--hierarchy::
|
||||
Enable hierarchy output.
|
||||
|
||||
--force::
|
||||
Don't do ownership validation.
|
||||
|
||||
|
||||
INTERACTIVE PROMPTING KEYS
|
||||
--------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -587,6 +587,13 @@ static void *display_thread_tui(void *arg)
|
|||
.refresh = top->delay_secs,
|
||||
};
|
||||
|
||||
/* In order to read symbols from other namespaces perf to needs to call
|
||||
* setns(2). This isn't permitted if the struct_fs has multiple users.
|
||||
* unshare(2) the fs so that we may continue to setns into namespaces
|
||||
* that we're observing.
|
||||
*/
|
||||
unshare(CLONE_FS);
|
||||
|
||||
perf_top__sort_new_samples(top);
|
||||
|
||||
/*
|
||||
|
|
@ -628,6 +635,13 @@ static void *display_thread(void *arg)
|
|||
struct perf_top *top = arg;
|
||||
int delay_msecs, c;
|
||||
|
||||
/* In order to read symbols from other namespaces perf to needs to call
|
||||
* setns(2). This isn't permitted if the struct_fs has multiple users.
|
||||
* unshare(2) the fs so that we may continue to setns into namespaces
|
||||
* that we're observing.
|
||||
*/
|
||||
unshare(CLONE_FS);
|
||||
|
||||
display_setup_sig();
|
||||
pthread__unblock_sigwinch();
|
||||
repeat:
|
||||
|
|
@ -1206,6 +1220,7 @@ 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, "force", &symbol_conf.force, "don't complain, do it"),
|
||||
OPT_END()
|
||||
};
|
||||
const char * const top_usage[] = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue