Blame SOURCES/oprofile-hugepage.patch

d5df0a
From 0246c6ba4a08378c46c17617d831d6baf0f44989 Mon Sep 17 00:00:00 2001
d5df0a
From: William Cohen <wcohen@redhat.com>
d5df0a
Date: Fri, 9 Jan 2015 16:44:09 -0500
d5df0a
Subject: [PATCH] Allow operf to track anon_hugepage mmap entries
d5df0a
d5df0a
The perf mmap information for anon_huge pages has a different filename
d5df0a
("/anon_hugepage") than the mmap information for regions composed of
d5df0a
normal sized pages ("//anon").  This results in opreport not being
d5df0a
able to map samples collected by operf to Java methods when the Java
d5df0a
VM uses statically allocated huge pages (rhbz1180512 and rhbz1180513).
d5df0a
d5df0a
Signed-off-by: William Cohen <wcohen@redhat.com>
d5df0a
---
d5df0a
 libperf_events/operf_utils.cpp | 4 ++++
d5df0a
 1 file changed, 4 insertions(+)
d5df0a
d5df0a
diff --git a/libperf_events/operf_utils.cpp b/libperf_events/operf_utils.cpp
d5df0a
index a87524b..90a0765 100644
d5df0a
--- a/libperf_events/operf_utils.cpp
d5df0a
+++ b/libperf_events/operf_utils.cpp
d5df0a
@@ -295,6 +295,10 @@ static void __handle_mmap_event(event_t * event)
d5df0a
 		                    strlen("//anon")) == 0)) {
d5df0a
 			mapping->is_anon_mapping = true;
d5df0a
 			strcpy(mapping->filename, "anon");
d5df0a
+		} else if ((strncmp(mapping->filename, "/anon_hugepage",
d5df0a
+		                    strlen("/anon_hugepage")) == 0)) {
d5df0a
+			mapping->is_anon_mapping = true;
d5df0a
+			strcpy(mapping->filename, "anon");
d5df0a
 		}
d5df0a
 		mapping->end_addr = (event->mmap.len == 0ULL)? 0ULL : mapping->start_addr + event->mmap.len - 1;
d5df0a
 		mapping->pgoff = event->mmap.pgoff;
d5df0a
-- 
d5df0a
2.1.0
d5df0a