[PATCH] perf: Fix missing vdso name in mmap events for x86

From: Adrian Hunter
Date: Tue Jul 15 2014 - 06:25:19 EST


Commit 78d683e838a60ec4ba4591cca4364cba84a9e626
added vm_ops->name as an alternative to arch_vma_name
but did not update perf events use of arch_vma_name().

Commit a62c34bd2a8a3f159945becd57401e478818d51c
removed "[vdso]" as a name returned by the x86 version of
arch_vma_name(), so the perf event for the vdso mapping
no longer had the correct name.

Fix by making perf events also use vm_ops->name.

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
---
kernel/events/core.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index a33d9a2b..a8740d1 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5266,6 +5266,12 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)

goto got_name;
} else {
+ if (vma->vm_ops && vma->vm_ops->name) {
+ name = (char *)vma->vm_ops->name(vma);
+ if (name)
+ goto cpy_name;
+ }
+
name = (char *)arch_vma_name(vma);
if (name)
goto cpy_name;
--
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/