Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1241895
| From | Yannick Brosseau <scientist@fb.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] perf: Correctly identify anon_hugepage when generating map |
| Date | 2015-10-08 02:40 +0200 |
| Message-ID | <qh7pv-4eQ-21@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
When parsing /proc/xxx/maps, the sscanf in perf_event__synthesize_mmap_events
truncate the map name at the space in "/anon_hugepage (deleted)".
is_anon_memory then only receive the string "/anon_hugepage" and do not detect it.
We change is_anon_memory to only compare the first part of the string
effectively ignoring if the (deleted) part is there or not.
Signed-off-by: Yannick Brosseau <scientist@fb.com>
---
tools/perf/util/map.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index b1c475d..9f7face 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -26,8 +26,8 @@ const char *map_type__name[MAP__NR_TYPES] = {
static inline int is_anon_memory(const char *filename)
{
return !strcmp(filename, "//anon") ||
- !strcmp(filename, "/dev/zero (deleted)") ||
- !strcmp(filename, "/anon_hugepage (deleted)");
+ !strncmp(filename, "/dev/zero", sizeof("/dev/zero")) ||
+ !strncmp(filename, "/anon_hugepage", sizeof("/anon_hugepage"));
}
static inline int is_no_dso_memory(const char *filename)
--
2.6.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] perf: Correctly identify anon_hugepage when generating map Yannick Brosseau <scientist@fb.com> - 2015-10-08 02:40 +0200 Re: [PATCH] perf: Correctly identify anon_hugepage when generating map Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-13 17:00 +0200
csiph-web