diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/event.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 052eaeccc202..571fb25f7eb9 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -130,6 +130,7 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid, | |||
130 | continue; | 130 | continue; |
131 | pbf += n + 3; | 131 | pbf += n + 3; |
132 | if (*pbf == 'x') { /* vm_exec */ | 132 | if (*pbf == 'x') { /* vm_exec */ |
133 | u64 vm_pgoff; | ||
133 | char *execname = strchr(bf, '/'); | 134 | char *execname = strchr(bf, '/'); |
134 | 135 | ||
135 | /* Catch VDSO */ | 136 | /* Catch VDSO */ |
@@ -139,6 +140,14 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid, | |||
139 | if (execname == NULL) | 140 | if (execname == NULL) |
140 | continue; | 141 | continue; |
141 | 142 | ||
143 | pbf += 3; | ||
144 | n = hex2u64(pbf, &vm_pgoff); | ||
145 | /* pgoff is in bytes, not pages */ | ||
146 | if (n >= 0) | ||
147 | ev.mmap.pgoff = vm_pgoff << getpagesize(); | ||
148 | else | ||
149 | ev.mmap.pgoff = 0; | ||
150 | |||
142 | size = strlen(execname); | 151 | size = strlen(execname); |
143 | execname[size - 1] = '\0'; /* Remove \n */ | 152 | execname[size - 1] = '\0'; /* Remove \n */ |
144 | memcpy(ev.mmap.filename, execname, size); | 153 | memcpy(ev.mmap.filename, execname, size); |