Commit 4af8b35d authored by Anton Blanchard's avatar Anton Blanchard Committed by Arnaldo Carvalho de Melo

perf symbols: Fill in pgoff in mmap synthesized events

When we synthesize mmap events we need to fill in the pgoff field.

I wasn't able to test this completely since I couldn't find an
executable region with a non 0 offset. We will see it when we start
doing data profiling.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Cc: David Miller <davem@davemloft.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20100403115331.GK5594@kryten>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent e206d556
...@@ -130,6 +130,7 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid, ...@@ -130,6 +130,7 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid,
continue; continue;
pbf += n + 3; pbf += n + 3;
if (*pbf == 'x') { /* vm_exec */ if (*pbf == 'x') { /* vm_exec */
u64 vm_pgoff;
char *execname = strchr(bf, '/'); char *execname = strchr(bf, '/');
/* Catch VDSO */ /* Catch VDSO */
...@@ -139,6 +140,14 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid, ...@@ -139,6 +140,14 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid,
if (execname == NULL) if (execname == NULL)
continue; continue;
pbf += 3;
n = hex2u64(pbf, &vm_pgoff);
/* pgoff is in bytes, not pages */
if (n >= 0)
ev.mmap.pgoff = vm_pgoff << getpagesize();
else
ev.mmap.pgoff = 0;
size = strlen(execname); size = strlen(execname);
execname[size - 1] = '\0'; /* Remove \n */ execname[size - 1] = '\0'; /* Remove \n */
memcpy(ev.mmap.filename, execname, size); memcpy(ev.mmap.filename, execname, size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment