lkml.org 
[lkml]   [2010]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] perf symbols: Fill in pgoff in mmap synthesized events

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

Signed-off-by: Anton Blanchard <anton@samba.org>
---

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.

Index: linux.trees.git/tools/perf/util/event.c
===================================================================
--- linux.trees.git.orig/tools/perf/util/event.c 2010-04-01 07:55:13.000000000 +1100
+++ linux.trees.git/tools/perf/util/event.c 2010-04-03 22:45:02.000000000 +1100
@@ -130,6 +130,7 @@ static int event__synthesize_mmap_events
continue;
pbf += n + 3;
if (*pbf == 'x') { /* vm_exec */
+ u64 vm_pgoff;
char *execname = strchr(bf, '/');

/* Catch VDSO */
@@ -139,6 +140,14 @@ static int event__synthesize_mmap_events
if (execname == NULL)
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);
execname[size - 1] = '\0'; /* Remove \n */
memcpy(ev.mmap.filename, execname, size);

\
 
 \ /
  Last update: 2010-04-03 13:57    [W:0.063 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site