mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Perf: add anonymous huge page recognition
@ 2013-01-05  5:29 Joshua Zhu
  2013-01-25 11:34 ` [tip:perf/core] perf tools: Add " tip-bot for Joshua Zhu
  0 siblings, 1 reply; 2+ messages in thread
From: Joshua Zhu @ 2013-01-05  5:29 UTC (permalink / raw)
  To: a.p.zijlstra, paulus, mingo, acme, namhyung, dsahern,
	akihiro.nagai.hw, jolsa, andi
  Cc: zhu.wen-jie, linux-kernel

Judging anonymous memory's vm_area_struct,
perf_mmap_event's filename will be set to
"//anon" indicating this vma is belong to
anonymous memory.
Once hugepage is used, vma's vm_file points
to hugetlbfs. In this way, this vma will not
be regarded as anonymous memory by is_anon_memory()
in perf user space utility.

Signed-off-by: Joshua Zhu <zhu.wen-jie@hp.com>
---
 tools/perf/util/map.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 0328d45..ff94425 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -19,7 +19,8 @@ const char *map_type__name[MAP__NR_TYPES] = {
 
 static inline int is_anon_memory(const char *filename)
 {
-	return strcmp(filename, "//anon") == 0;
+	return !strcmp(filename, "//anon") ||
+	       !strcmp(filename, "/anon_hugepage (deleted)");
 }
 
 static inline int is_no_dso_memory(const char *filename)
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-25 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-05  5:29 [PATCH] Perf: add anonymous huge page recognition Joshua Zhu
2013-01-25 11:34 ` [tip:perf/core] perf tools: Add " tip-bot for Joshua Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome