[PATCH] Allow operf to track anon_hugepage mmap entries

William Cohen <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <[email protected]>
The perf mmap information for anon_huge pages has a different filename
("/anon_hugepage") than the mmap information for regions composed of
normal sized pages ("//anon").  This results in opreport not being
able to map samples collected by operf to Java methods when the Java
VM uses statically allocated huge pages (rhbz1180512 and rhbz1180513).

Signed-off-by: William Cohen <[email protected]>
---
 libperf_events/operf_utils.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libperf_events/operf_utils.cpp b/libperf_events/operf_utils.cpp
index a87524b..90a0765 100644
--- a/libperf_events/operf_utils.cpp
+++ b/libperf_events/operf_utils.cpp
@@ -295,6 +295,10 @@ static void __handle_mmap_event(event_t * event)
 		                    strlen("//anon")) == 0)) {
 			mapping->is_anon_mapping = true;
 			strcpy(mapping->filename, "anon");
+		} else if ((strncmp(mapping->filename, "/anon_hugepage",
+		                    strlen("/anon_hugepage")) == 0)) {
+			mapping->is_anon_mapping = true;
+			strcpy(mapping->filename, "anon");
 		}
 		mapping->end_addr = (event->mmap.len == 0ULL)? 0ULL : mapping->start_addr + event->mmap.len - 1;
 		mapping->pgoff = event->mmap.pgoff;
-- 
2.1.0


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.