Skip to contentSkip to conversation

perf: Add vm_ops->name call for mmap event name retrieval

PATCH In review Jiri Olsa 5 participants 10 messages Jul 14, 2014 – Jul 16, 2014 perf events

lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

PATCH 1/1 perf: Add vm_ops->name call for mmap event name retrieval

Following patch added another way to get mmap name:
78d683e mm, fs: Add vm_ops->name as an alternative to arch_vma_name

The vdso vma mapping already switch to this and we no longer get vdso name via arch_vma_name function. Adding this way to the perf mmap event name retrieval code.

Caught this via perf test:

  $ sudo ./perf test -v 7
   7: Validate PERF_RECORD_* events & perf_sample fields     :
  --- start ---

SNIP

PERF_RECORD_MMAP for [vdso] missing!
test child finished with 255
---- end ----
Validate PERF_RECORD_* events & perf_sample fields: FAILED!

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Corey Ashford <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 kernel/events/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/events/core.c +6 -0
index 67e3b9c..4799676 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.1
maintainer
#1 lore raw
Quoted 2 lines · Jiri Olsa

Following patch added another way to get mmap name:
78d683e mm, fs: Add vm_ops->name as an alternative to arch_vma_name

Please add to your .gitconfig:

[core]

        abbrev = 12

Also, you failed to CC the two people involved in that.

Quoted 50 lines

The vdso vma mapping already switch to this and we no longer get vdso name via arch_vma_name function. Adding this way to the perf mmap event name retrieval code.

Caught this via perf test:

  $ sudo ./perf test -v 7
   7: Validate PERF_RECORD_* events & perf_sample fields     :
  --- start ---

SNIP

PERF_RECORD_MMAP for [vdso] missing!
test child finished with 255
---- end ----
Validate PERF_RECORD_* events & perf_sample fields: FAILED!

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Corey Ashford <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 kernel/events/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/events/core.c +6 -0
index 67e3b9c..4799676 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.1
maintainer
#2 lore raw
Quoted 10 lines · Peter Zijlstra
Quoted 2 lines · Jiri Olsa

Following patch added another way to get mmap name:
78d683e mm, fs: Add vm_ops->name as an alternative to arch_vma_name

Please add to your .gitconfig:

[core]

        abbrev = 12

Also, you failed to CC the two people involved in that.

In any case, this patch appears to be tip only for now, so I'll queue it in perf/core.

#3 lore raw
In reply to Peter Zijlstra
Quoted 47 lines · Peter Zijlstra
Quoted 2 lines · Jiri Olsa

Following patch added another way to get mmap name:
78d683e mm, fs: Add vm_ops->name as an alternative to arch_vma_name

Please add to your .gitconfig:

[core]

        abbrev = 12

Also, you failed to CC the two people involved in that.

Quoted 36 lines

The vdso vma mapping already switch to this and we no longer get vdso name via arch_vma_name function. Adding this way to the perf mmap event name retrieval code.

Caught this via perf test:

  $ sudo ./perf test -v 7
   7: Validate PERF_RECORD_* events & perf_sample fields     :
  --- start ---

SNIP

PERF_RECORD_MMAP for [vdso] missing!
test child finished with 255
---- end ----
Validate PERF_RECORD_* events & perf_sample fields: FAILED!

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Corey Ashford <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 kernel/events/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/events/core.c +0 -0
index 67e3b9c..4799676 100644
@@ -5266,6 +5266,12 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
 
Quoted 8 lines

kernel/events/core.c static void perf_event_mmap_event(struct perf_mmap_event *mmap_event) · line 5274

Quoted 8 lines
kernel/events/core.c +6 -0
              goto got_name;
      } else {
+             if (vma->vm_ops && vma->vm_ops->name) {
+                     name = (char *) vma->vm_ops->name(vma);
+                     if (name)
+                             goto cpy_name;
+             }
+

Looks good to me. Sorry I missed that.

--Andy

Quoted 6 lines
Quoted 6 lines
kernel/events/core.c +0 -1
              name = (char *)arch_vma_name(vma);
              if (name)
                      goto cpy_name;
--

1.8.3.1

Signature · 2 lines
Andy Lutomirski
AMA Capital Management, LLC
maintainer
#4 lore raw
Quoted 2 lines · Andy Lutomirski

Looks good to me. Sorry I missed that.

Can I make that an Acked-by?

#7 lore raw
In reply to Peter Zijlstra
Quoted 8 lines · Peter Zijlstra
Quoted 2 lines · Jiri Olsa

Following patch added another way to get mmap name:
78d683e mm, fs: Add vm_ops->name as an alternative to arch_vma_name

Please add to your .gitconfig:

[core]

        abbrev = 12

hum, will check

Quoted 2 lines

Also, you failed to CC the two people involved in that.

ouch.. sry

jirka

maintainer
#8 lore raw
Quoted 11 lines · Jiri Olsa
Quoted 8 lines · Peter Zijlstra
Quoted 2 lines · Jiri Olsa

Following patch added another way to get mmap name:
78d683e mm, fs: Add vm_ops->name as an alternative to arch_vma_name

Please add to your .gitconfig:

[core]

        abbrev = 12

hum, will check

Mandated by Linus, also I've already had 8 char hash collisions, so it really makes sense.

#9 lore raw

[tip:perf/core] perf: Add vm_ops-> name call for mmap event name retrieval

In reply to Jiri Olsa
perf: Add vm_ops->name call for mmap event name retrieval
Commit-ID:  fbe26abe118ee1262b4ab0d12fefd42647eaea35
Gitweb:     http://git.kernel.org/tip/fbe26abe118ee1262b4ab0d12fefd42647eaea35
Author:     Jiri Olsa <[email protected]>
AuthorDate: Mon, 14 Jul 2014 17:57:19 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 16 Jul 2014 13:31:22 +0200

perf: Add vm_ops->name call for mmap event name retrieval

The following patch added another way to get mmap name: 78d683e838a6 ("mm, fs: Add vm_ops->name as an alternative to arch_vma_name")

The vdso vma mapping already switch to this and we no longer get vdso name via arch_vma_name function. Adding this way to the perf mmap event name retrieval code.

Caught this via perf test:

  $ sudo ./perf test -v 7
   7: Validate PERF_RECORD_* events & perf_sample fields     :
  --- start ---

SNIP

PERF_RECORD_MMAP for [vdso] missing!
test child finished with 255
---- end ----
Validate PERF_RECORD_* events & perf_sample fields: FAILED!

---
 kernel/events/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/events/core.c +6 -0
index 67e3b9c..4799676 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;