Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] Perf: add anonymous huge page recognition

15 views
Skip to first unread message

Joshua Zhu

unread,
Jan 5, 2013, 12:40:02 AM1/5/13
to
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.w...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

tip-bot for Joshua Zhu

unread,
Jan 25, 2013, 6:40:02 AM1/25/13
to
Commit-ID: d0528b5d71faf612014dd7672e44225c915344b2
Gitweb: http://git.kernel.org/tip/d0528b5d71faf612014dd7672e44225c915344b2
Author: Joshua Zhu <zhu.w...@hp.com>
AuthorDate: Sat, 5 Jan 2013 13:29:57 +0800
Committer: Arnaldo Carvalho de Melo <ac...@redhat.com>
CommitDate: Thu, 24 Jan 2013 16:40:19 -0300

perf tools: Add anonymous huge page recognition

Judging anonymous memory's vm_area_struct, perf_mmap_event's filename
will be set to "//anon" indicating this vma belongs 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.w...@hp.com>
Cc: Akihiro Nagai <akihiro....@hitachi.com>
Cc: Andi Kleen <an...@firstfloor.org>
Cc: David Ahern <dsa...@gmail.com>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: Jiri Olsa <jo...@redhat.com>
Cc: Joshua Zhu <zhu.w...@hp.com>
Cc: Namhyung Kim <namh...@kernel.org>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Peter Zijlstra <a.p.zi...@chello.nl>
Link: http://lkml.kernel.org/r/1357363797-3550-1-git-...@hp.com
Signed-off-by: Arnaldo Carvalho de Melo <ac...@redhat.com>
---
tools/perf/util/map.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

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)
--
0 new messages