From: Arnaldo Carvalho de Melo <[email protected]>
The event interception we need to to din 'perf record' to create a list
of all DSOs in PERF_RECORD_MMAP events wasn't seeing all events, make
sure that happens by checking size agains event_t->header.size.
Cc: Frédéric Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Paul Mackerras <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/builtin-record.c | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 614fa9a..7bb9ca1 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -113,16 +113,24 @@ static void write_output(void *buf, size_t size)
static void write_event(event_t *buf, size_t size)
{
- /*
- * Add it to the list of DSOs, so that when we finish this
- * record session we can pick the available build-ids.
- */
- if (buf->header.type == PERF_RECORD_MMAP) {
- struct list_head *head = &dsos__user;
- if (buf->mmap.header.misc == 1)
- head = &dsos__kernel;
- __dsos__findnew(head, buf->mmap.filename);
- }
+ size_t processed_size = buf->header.size;
+ event_t *ev = buf;
+
+ do {
+ /*
+ * Add it to the list of DSOs, so that when we finish this
+ * record session we can pick the available build-ids.
+ */
+ if (ev->header.type == PERF_RECORD_MMAP) {
+ struct list_head *head = &dsos__user;
+ if (ev->header.misc == 1)
+ head = &dsos__kernel;
+ __dsos__findnew(head, ev->mmap.filename);
+ }
+
+ ev = ((void *)ev) + ev->header.size;
+ processed_size += ev->header.size;
+ } while (processed_size < size);
write_output(buf, size);
}
--
1.6.2.5
From: Arnaldo Carvalho de Melo <[email protected]>
As it is in PARISC64:
parisc:~# uname -a
Linux parisc 2.6.33-rc4-tip+ #1 SMP Thu Jan 14 13:33:34 BRST 2010 parisc64 GNU/Linux
parisc:~# grep -w _text /proc/kallsyms
0000000040100000 A _text
parisc:~# grep 0000000040100000 /proc/kallsyms
0000000040100000 T stext
0000000040100000 T _stext
0000000040100000 A _text
parisc:~#
Cc: Frédéric Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Paul Mackerras <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/util/event.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 966d207..dc13cad 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -227,7 +227,12 @@ static int find_symbol_cb(void *arg, const char *name, char type, u64 start)
{
struct process_symbol_args *args = arg;
- if (!symbol_type__is_a(type, MAP__FUNCTION) || strcmp(name, args->name))
+ /*
+ * Must be a function or at least an alias, as in PARISC64, where "_text" is
+ * an 'A' to the same address as "_stext".
+ */
+ if (!(symbol_type__is_a(type, MAP__FUNCTION) ||
+ type == 'A') || strcmp(name, args->name))
return 0;
args->start = start;
--
1.6.2.5