From: tip-bot for Krister Johansen <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com,
acme@redhat.com, kjlx@templeofstupid.com, tglx@linutronix.de,
tmricht@linux.vnet.ibm.com, hpa@zytor.com, peterz@infradead.org,
mingo@kernel.org, brendan.d.gregg@gmail.com
Subject: [tip:perf/core] perf top: Support lookup of symbols in other mount namespaces.
Date: Wed, 26 Jul 2017 10:23:45 -0700 [thread overview]
Message-ID: <tip-868a832918f621b7576655c00067f20326ef3931@git.kernel.org> (raw)
In-Reply-To: <1499305693-1599-6-git-send-email-kjlx@templeofstupid.com>
Commit-ID: 868a832918f621b7576655c00067f20326ef3931
Gitweb: http://git.kernel.org/tip/868a832918f621b7576655c00067f20326ef3931
Author: Krister Johansen <kjlx@templeofstupid.com>
AuthorDate: Wed, 5 Jul 2017 18:48:12 -0700
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 25 Jul 2017 22:43:16 -0300
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 <kjlx@templeofstupid.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1499305693-1599-6-git-send-email-kjlx@templeofstupid.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-top.txt | 4 ++++
tools/perf/builtin-top.c | 15 +++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
index e71d638..d864ea6 100644
--- a/tools/perf/Documentation/perf-top.txt
+++ b/tools/perf/Documentation/perf-top.txt
@@ -237,6 +237,10 @@ Default is to monitor all CPUS.
--hierarchy::
Enable hierarchy output.
+--force::
+ Don't do ownership validation.
+
+
INTERACTIVE PROMPTING KEYS
--------------------------
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index e5a8f24..ee954bd 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -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[] = {
next prev parent reply other threads:[~2017-07-26 17:27 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-01 2:18 [PATCH tip/perf/core 0/7] namespace tracing improvements Krister Johansen
2017-07-01 2:18 ` [PATCH tip/perf/core 1/7] perf symbols: find symbols in different mount namespace Krister Johansen
2017-07-03 18:38 ` Arnaldo Carvalho de Melo
2017-07-05 20:44 ` Krister Johansen
2017-07-01 2:18 ` [PATCH tip/perf/core 2/7] perf maps: lookup maps in both intitial mountns and inner mountns Krister Johansen
2017-07-03 18:44 ` Arnaldo Carvalho de Melo
2017-07-01 2:18 ` [PATCH tip/perf/core 3/7] perf probe: allow placing uprobes in alternate namespaces Krister Johansen
2017-07-03 18:46 ` Arnaldo Carvalho de Melo
2017-07-05 20:45 ` Krister Johansen
2017-07-01 2:18 ` [PATCH tip/perf/core 4/7] perf buildid-cache: support binary objects from other namespaces Krister Johansen
2017-07-01 2:18 ` [PATCH tip/perf/core 5/7] perf top: support lookup of symbols in other mount namespaces Krister Johansen
2017-07-01 2:18 ` [PATCH tip/perf/core 6/7] perf documentation: updates for target-ns Krister Johansen
2017-07-03 18:48 ` Arnaldo Carvalho de Melo
2017-07-05 20:45 ` Krister Johansen
2017-07-06 1:48 ` [PATCH v2 tip/perf/core 0/6] namespace tracing improvements Krister Johansen
2017-07-06 1:48 ` [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in different mount namespace Krister Johansen
2017-07-06 19:41 ` Arnaldo Carvalho de Melo
2017-07-07 19:36 ` Krister Johansen
2017-07-10 6:17 ` Thomas-Mich Richter
2017-07-10 22:39 ` Krister Johansen
2017-07-10 22:52 ` Arnaldo Carvalho de Melo
2017-07-10 23:29 ` Krister Johansen
2017-07-11 12:51 ` Arnaldo Carvalho de Melo
2017-07-11 17:15 ` Krister Johansen
2017-07-20 8:48 ` [tip:perf/core] perf symbols: Find " tip-bot for Krister Johansen
2017-07-06 1:48 ` [PATCH v2 tip/perf/core 2/6] perf maps: lookup maps in both intitial mountns and inner mountns Krister Johansen
2017-07-20 8:48 ` [tip:perf/core] perf maps: Lookup " tip-bot for Krister Johansen
2017-07-06 1:48 ` [PATCH v2 tip/perf/core 3/6] perf probe: allow placing uprobes in alternate namespaces Krister Johansen
2017-07-17 10:32 ` [PATCH] perf probe: Fix build failure for get_target_map() Ravi Bangoria
2017-07-17 13:11 ` Arnaldo Carvalho de Melo
2017-07-18 9:19 ` Michael Ellerman
2017-07-18 15:45 ` Arnaldo Carvalho de Melo
2017-07-19 5:58 ` Michael Ellerman
2017-07-20 8:48 ` [tip:perf/core] perf probe: Allow placing uprobes in alternate namespaces tip-bot for Krister Johansen
2017-07-06 1:48 ` [PATCH v2 tip/perf/core 4/6] perf buildid-cache: support binary objects from other namespaces Krister Johansen
2017-07-20 8:49 ` [tip:perf/core] perf buildid-cache: Support " tip-bot for Krister Johansen
2017-07-06 1:48 ` [PATCH v2 tip/perf/core 5/6] perf top: support lookup of symbols in other mount namespaces Krister Johansen
2017-07-21 17:10 ` Arnaldo Carvalho de Melo
2017-07-26 17:23 ` tip-bot for Krister Johansen [this message]
2017-07-06 1:48 ` [PATCH v2 tip/perf/core 6/6] perf buildid-cache: cache debuginfo Krister Johansen
2017-07-20 8:49 ` [tip:perf/core] perf buildid-cache: Cache debuginfo tip-bot for Krister Johansen
2017-07-01 2:18 ` [PATCH tip/perf/core 7/7] perf buildid-cache: cache debuginfo Krister Johansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-868a832918f621b7576655c00067f20326ef3931@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=brendan.d.gregg@gmail.com \
--cc=hpa@zytor.com \
--cc=kjlx@templeofstupid.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tmricht@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome