* [PATCH] perf symbols: Fill in pgoff in mmap synthesized events
@ 2010-04-03 11:53 Anton Blanchard
2010-04-03 13:40 ` Arnaldo Carvalho de Melo
2010-04-03 16:25 ` [tip:perf/core] " tip-bot for Anton Blanchard
0 siblings, 2 replies; 3+ messages in thread
From: Anton Blanchard @ 2010-04-03 11:53 UTC (permalink / raw)
To: David Miller, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo
Cc: linux-kernel
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);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] perf symbols: Fill in pgoff in mmap synthesized events
2010-04-03 11:53 [PATCH] perf symbols: Fill in pgoff in mmap synthesized events Anton Blanchard
@ 2010-04-03 13:40 ` Arnaldo Carvalho de Melo
2010-04-03 16:25 ` [tip:perf/core] " tip-bot for Anton Blanchard
1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-04-03 13:40 UTC (permalink / raw)
To: Anton Blanchard
Cc: David Miller, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
linux-kernel
Em Sat, Apr 03, 2010 at 10:53:31PM +1100, Anton Blanchard escreveu:
>
> When we synthesize mmap events we need to fill in the pgoff field.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Thanks Anton,
Ingo, I added this one to my perf branch after fixing that
branch due to a problem with the removal of tools/perf/util/string.h.
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:perf/core] perf symbols: Fill in pgoff in mmap synthesized events
2010-04-03 11:53 [PATCH] perf symbols: Fill in pgoff in mmap synthesized events Anton Blanchard
2010-04-03 13:40 ` Arnaldo Carvalho de Melo
@ 2010-04-03 16:25 ` tip-bot for Anton Blanchard
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Anton Blanchard @ 2010-04-03 16:25 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, paulus, anton, hpa, mingo, a.p.zijlstra,
davem, tglx
Commit-ID: 4af8b35db6634dd1e0d616de689582b6c93550af
Gitweb: http://git.kernel.org/tip/4af8b35db6634dd1e0d616de689582b6c93550af
Author: Anton Blanchard <anton@samba.org>
AuthorDate: Sat, 3 Apr 2010 22:53:31 +1100
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Sat, 3 Apr 2010 10:20:31 -0300
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: Anton 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: Arnaldo Carvalho de Melo <acme@redhat.com>
---
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 052eaec..571fb25 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,
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(pid_t pid, pid_t tgid,
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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-03 16:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-03 11:53 [PATCH] perf symbols: Fill in pgoff in mmap synthesized events Anton Blanchard
2010-04-03 13:40 ` Arnaldo Carvalho de Melo
2010-04-03 16:25 ` [tip:perf/core] " tip-bot for Anton Blanchard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.