Skip to contentSkip to conversation

perf: Fix missing vdso name in mmap events for x86

PATCH In review Adrian Hunter 2 participants 3 messages Jul 15, 2014 perf events

lore
Share & tools
lore

Adrian Hunter

author reviewer
#0 lore raw

PATCH 1/1 perf: Fix missing vdso name in mmap events for x86

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.

---
 kernel/events/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/events/core.c +6 -0
index a33d9a2b..a8740d1 100644
@@ -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;
Signature · 1 line
1.8.3.2
maintainer
#1 lore raw
Quoted 4 lines · Adrian Hunter

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

Quoted 8 lines

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.

I've already got:
http://lkml.kernel.org/r/[email protected]

author reviewer
#2 lore raw
Quoted 10 lines · Peter Zijlstra
Quoted 9 lines · Adrian Hunter

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.

Quoted 7 lines
Quoted 3 lines

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

I've already got:
http://lkml.kernel.org/r/[email protected]

Sorry, didn't see that.