linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	David Ahern <dsahern@gmail.com>, Andi Kleen <ak@linux.intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH 2/2] perf tools: Skip read of kernel maps once it failed
Date: Fri, 19 Jan 2018 17:11:03 +0100	[thread overview]
Message-ID: <20180119161103.15035-3-jolsa@kernel.org> (raw)
In-Reply-To: <20180119161103.15035-1-jolsa@kernel.org>

Current perf report is real slow on newer kernels,
with following commit:
  c0f3ea158939 ("stop using '%pK' for /proc/kallsyms pointer values")

which prevent pointers in /proc/kallsyms, in case
kernel.perf_event_paranoid=2.

That makes perf to fail in finding kernel map details,
and keep parsing it again for every kernel sample.

Adding and setting a new machine::vmlinux_maps_failed
flag after first failed parsing attempt and using it
to prevent new pointless parsing.

TODO We might want to add some perf report warning
about that.

Link: http://lkml.kernel.org/n/tip-ld2kp994rhz6i341igt8f98y@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/machine.c | 6 ++++--
 tools/perf/util/machine.h | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index b05a67464c03..5e9648817077 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1222,13 +1222,15 @@ int machine__create_kernel_maps(struct machine *machine)
 	u64 addr = 0;
 	int ret;
 
-	if (kernel == NULL)
+	if (kernel == NULL || machine->vmlinux_maps_failed)
 		return -1;
 
 	ret = __machine__create_kernel_maps(machine, kernel);
 	dso__put(kernel);
-	if (ret < 0)
+	if (ret < 0) {
+		machine->vmlinux_maps_failed = true;
 		return -1;
+	}
 
 	if (symbol_conf.use_modules && machine__create_modules(machine) < 0) {
 		if (machine__is_host(machine))
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 5ce860b64c74..edcb007333cb 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -42,6 +42,7 @@ struct machine {
 	u16		  id_hdr_size;
 	bool		  comm_exec;
 	bool		  kptr_restrict_warned;
+	bool		  vmlinux_maps_failed;
 	char		  *root_dir;
 	struct threads    threads[THREADS__TABLE_SIZE];
 	struct vdso_info  *vdso_info;
-- 
2.13.6

  parent reply	other threads:[~2018-01-19 16:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 16:11 [PATCH 0/2] perf report: Fix kallsyms parsing Jiri Olsa
2018-01-19 16:11 ` [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse Jiri Olsa
2018-01-26  6:36   ` Namhyung Kim
2018-01-26 17:22   ` Andy Shevchenko
2018-01-26 17:27     ` Andy Shevchenko
2018-01-29  7:18       ` Jiri Olsa
2018-01-29 13:05         ` Andy Shevchenko
2018-01-19 16:11 ` Jiri Olsa [this message]
2018-01-26  6:48   ` [PATCH 2/2] perf tools: Skip read of kernel maps once it failed Namhyung Kim
2018-01-30 11:21     ` Jiri Olsa

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=20180119161103.15035-3-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).