From: Jiri Olsa <jolsa@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Michael Petlan <mpetlan@redhat.com>,
Ian Rogers <irogers@google.com>
Subject: [PATCH 02/10] perf: Move build_id_parse to check only regular files
Date: Tue, 22 Jun 2021 17:39:10 +0200 [thread overview]
Message-ID: <20210622153918.688500-3-jolsa@kernel.org> (raw)
In-Reply-To: <20210622153918.688500-1-jolsa@kernel.org>
Moving the build_id_parse function to place where it
parses only regular files.
There's no change wrt maps we generate the build id for,
because we get parsed build ids for only for regular
files (non-special files) anyway.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
kernel/events/core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index d83ccb58a3c1..3f1630c06195 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8336,6 +8336,12 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
maj = MAJOR(dev);
min = MINOR(dev);
+ if (atomic_read(&nr_build_id_events) && *name == '/') {
+ int err = build_id_parse(vma, mmap_event->build_id,
+ &mmap_event->build_id_size);
+ mmap_event->build_id_fault = err == -EFAULT;
+ }
+
goto got_name;
} else {
if (vma->vm_ops && vma->vm_ops->name) {
@@ -8390,12 +8396,6 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
mmap_event->event_id.header.size = sizeof(mmap_event->event_id) + size;
- if (atomic_read(&nr_build_id_events)) {
- int err = build_id_parse(vma, mmap_event->build_id,
- &mmap_event->build_id_size);
- mmap_event->build_id_fault = err == -EFAULT;
- }
-
perf_iterate_sb(perf_event_mmap_output,
mmap_event,
NULL);
--
2.31.1
next prev parent reply other threads:[~2021-06-22 15:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-22 15:39 [RFC 00/10] perf: Add build id parsing fault detection/fix Jiri Olsa
2021-06-22 15:39 ` [PATCH 01/10] perf: Track build id faults for mmap2 event Jiri Olsa
2021-06-22 15:39 ` Jiri Olsa [this message]
2021-06-22 15:39 ` [PATCH 03/10] perf: Add new read_format bit to read build id faults Jiri Olsa
2021-06-22 15:39 ` [PATCH 04/10] perf: Add new read_format bit to read lost events Jiri Olsa
2021-06-22 15:39 ` [PATCH 05/10] tools: Sync perf_event.h uapi Jiri Olsa
2021-06-22 15:39 ` [PATCH 06/10] libperf: Do not allow PERF_FORMAT_GROUP in perf_evsel__read Jiri Olsa
2021-06-22 15:39 ` [PATCH 07/10] perf record: Add support to read build id fails Jiri Olsa
2021-06-22 15:39 ` [PATCH 08/10] perf record: Add new HEADER_BUILD_ID_MMAP feature Jiri Olsa
2021-06-22 15:39 ` [PATCH 09/10] perf report: Display build id fails stats Jiri Olsa
2021-06-22 15:39 ` [PATCH 10/10] perf inject: Add --buildid-mmap2 option to fix failed build ids Jiri Olsa
2021-06-22 17:39 ` [RFC 00/10] perf: Add build id parsing fault detection/fix Arnaldo Carvalho de Melo
2021-06-22 17:47 ` Ian Rogers
2021-06-22 18:14 ` Arnaldo Carvalho de Melo
2021-06-22 21:19 ` Jiri Olsa
2021-06-23 19:48 ` Namhyung Kim
2021-06-24 11:44 ` Michael Petlan
2021-06-27 17:27 ` Jiri Olsa
2021-06-27 17:25 ` Jiri Olsa
2021-06-28 3:39 ` Namhyung Kim
2021-06-23 20:15 ` Namhyung Kim
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=20210622153918.688500-3-jolsa@kernel.org \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=mpetlan@redhat.com \
--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
all inboxes | Powered by JetHome®