All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip v2 0/6] perf script: add BTS analysis features
@ 2011-07-17  9:30 Akihiro Nagai
  2011-07-17  9:30 ` [PATCH -tip v2 1/6] [BUGFIX] perf script: print correct IP address Akihiro Nagai
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-17  9:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, David Ahern
  Cc: linux-kernel, Masami Hiramatsu, yrl.pp-manager.tt

Hi Frederic, David,

This patch series adds the functions to analyze BTS logs to perf-script and,
makes perf-script more informative version 2.
The patches add the following functions.
 - Output correct IP address
 - Output "(unknown)" as symbol name when perf-script can't resolve symbols.
 - Output "[unknown]" as DSO name when perf-script can't resolve DSO path.
 - Resolve DSOs and symbols for user-space address
 - Resolve DSOs and symbols for BTS's branch_from addresses
 - Show the offset of symbols with the 'offs' field specifier.
 - Resolve the real path of [kernel.kallsym] using
   '--show-kernel-path' option.

Usage:
First, get the BTS log with the following command.
# perf record -e branches:u -c 1 -d <command>

Second, analyze that trace data.
# perf script -f ip,addr,sym,offs,dso [--show-kernel-path]
This command's output format is:
<branch_to addr> <branch_to function+offset> <branch_to DSO> <branch_from addr> <branch_from function+offset> <branch_from DSO>

Output sample:
# perf record -e branches:u -c 1 -d ls
[snip]
# perf script -f ip,addr,sym,dso,offs --show-kernel-path

301ec016b0      (unknown) (/lib/modules/3.0.0-rc6-tip+/build/vmlinux) ffffffff81467612 irq_return+0x0 (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
301ec016b0     _start+0x0 (/lib64/ld-2.14.so) ffffffff81467612 irq_return+0x0 (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
301ec04b70  _dl_start+0x0 (/lib64/ld-2.14.so)       301ec016b3 _start+0x3 (/lib64/ld-2.14.so)
301ec04b70  _dl_start+0x0 (/lib64/ld-2.14.so) ffffffff81467612 irq_return+0x0 (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
301ec04b96 _dl_start+0x26 (/lib64/ld-2.14.so) ffffffff81467612 irq_return+0x0 (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
301ec04b9d _dl_start+0x2d (/lib64/ld-2.14.so) ffffffff81467612 irq_return+0x0 (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
301ec04c0d _dl_start+0x9d (/lib64/ld-2.14.so)       301ec04beb _dl_start+0x7b (/lib64/ld-2.14.so)
[snip]
401fd0                 main+0x0 (/root/bin/ls)       301f021399 __libc_start_main+0xe9 (/lib64/libc-2.14.so)
409ad0     set_program_name+0x0 (/root/bin/ls)           401ff3 main+0x23 (/root/bin/ls)
409ad0     set_program_name+0x0 (/root/bin/ls) ffffffff81467612 irq_return+0x0 (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
401ca8          strrchr@plt+0x0 (/root/bin/ls)           409ade set_program_name+0xe (/root/bin/ls)
401cae          strrchr@plt+0x6 (/root/bin/ls)           401ca8 strrchr@plt+0x0 (/root/bin/ls)
401a38               _init+0x18 (/root/bin/ls)           401cb3 strrchr@plt+0xb (/root/bin/ls)
301ec13840 _dl_runtime_resolve+0x0 (/lib64/ld-2.14.so)   401a3e _init+0x1e (/root/bin/ls)
301ec0d6a0        _dl_fixup+0x0 (/lib64/ld-2.14.so)  301ec13870 _dl_runtime_resolve+0x30 (/lib64/ld-2.14.so)
[snip]

It shows the tracee application's execution path.


TODO:
 - add source code path field, line number field ...etc.
 - add record/report script to use easily and, show human-friendly output.
 - filtering kernel functions using scripts

Changes in v2:
 - add a bug fix patch that prints correct IP address
 - output the magic word "(unknown)" as symbol name when perf-script can't
   resolve symbols.
 - output "[unknown]" as DSO name when perf-script can't resolve DSO path.
 - change the way to output offset of symbols from '--show-symbol-offset' to
   'offs' field.
 - clean up codes.

Thanks,

---

Akihiro Nagai (6):
      perf script: add option resolving vmlinux path
      perf script: add the offset field specifier
      perf script: print DSOs and symbols for BTS branch_from addr
      perf script: resolve DSOs and symbols for user-space
      perf script: add magic word to indicate the failure of resolving symbols
      [BUGFIX] perf script: print correct IP address


 tools/perf/Documentation/perf-script.txt |    5 +++
 tools/perf/builtin-script.c              |   46 +++++++++++++++++++++---------
 tools/perf/util/event.c                  |    5 +++
 tools/perf/util/map.c                    |   15 ++++++++++
 tools/perf/util/map.h                    |    1 +
 tools/perf/util/session.c                |   42 ++++++++++-----------------
 tools/perf/util/session.h                |    3 +-
 tools/perf/util/symbol.c                 |   21 ++++++++++++++
 tools/perf/util/symbol.h                 |    4 +++
 9 files changed, 100 insertions(+), 42 deletions(-)

-- 
Akihiro Nagai (akihiro.nagai.hw@hitachi.com)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH -tip v2 1/6] [BUGFIX] perf script: print correct IP address
  2011-07-17  9:30 [PATCH -tip v2 0/6] perf script: add BTS analysis features Akihiro Nagai
@ 2011-07-17  9:30 ` Akihiro Nagai
  2011-07-17 15:59   ` David Ahern
  2011-07-17  9:30 ` [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols Akihiro Nagai
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-17  9:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, David Ahern
  Cc: linux-kernel, Masami Hiramatsu, yrl.pp-manager.tt, Akihiro Nagai,
	Peter Zijlstra, Frederic Weisbecker, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, David Ahern, Masami Hiramatsu

perf_session_print_ip() prints addr_location->addr as IP address.
It's not always same as IP address. To correct it, this function
must print sample->ip.

Changes in v2:
 - add this patch

Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---

 tools/perf/util/session.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 080e533..453a010 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1263,7 +1263,7 @@ void perf_session__print_ip(union perf_event *event,
 		}
 
 	} else {
-		printf("%16" PRIx64, al.addr);
+		printf("%16" PRIx64, sample->ip);
 		if (print_sym) {
 			if (al.sym && al.sym->name)
 				symname = al.sym->name;


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols
  2011-07-17  9:30 [PATCH -tip v2 0/6] perf script: add BTS analysis features Akihiro Nagai
  2011-07-17  9:30 ` [PATCH -tip v2 1/6] [BUGFIX] perf script: print correct IP address Akihiro Nagai
@ 2011-07-17  9:30 ` Akihiro Nagai
  2011-07-17 16:07   ` David Ahern
  2011-07-17  9:30 ` [PATCH -tip v2 3/6] perf script: resolve DSOs and symbols for user-space Akihiro Nagai
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-17  9:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, David Ahern
  Cc: linux-kernel, Masami Hiramatsu, yrl.pp-manager.tt, Akihiro Nagai,
	Peter Zijlstra, Frederic Weisbecker, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, David Ahern, Masami Hiramatsu

Latest perf-script doesn't output symbol name when it failed to
resolve symbol name. This output is not friendly for external scripts
because it causes misaligment. So, this patch adds the magic word
"(unknown)" when perf-script failed to resolve symbols.

At the same time, this patch changes perf-script to output "[unknown]"
in the DSO field, when it failed to resolve the path of DSOs.

Changes in v2:
 - add this patch

Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---

 tools/perf/builtin-script.c |   18 +++++-------------
 tools/perf/util/map.c       |   12 ++++++++++++
 tools/perf/util/map.h       |    1 +
 tools/perf/util/session.c   |   35 ++++++++++-------------------------
 tools/perf/util/symbol.c    |   12 ++++++++++++
 tools/perf/util/symbol.h    |    1 +
 6 files changed, 41 insertions(+), 38 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 09024ec..b3e0951 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -320,7 +320,6 @@ static void print_sample_addr(union perf_event *event,
 {
 	struct addr_location al;
 	u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
-	const char *symname, *dsoname;
 
 	printf("%16" PRIx64, sample->addr);
 
@@ -340,21 +339,14 @@ static void print_sample_addr(union perf_event *event,
 		al.sym = map__find_symbol(al.map, al.addr, NULL);
 
 	if (PRINT_FIELD(SYM)) {
-		if (al.sym && al.sym->name)
-			symname = al.sym->name;
-		else
-			symname = "";
-
-		printf(" %16s", symname);
+		printf(" ");
+		symbol__print_symname(al.sym);
 	}
 
 	if (PRINT_FIELD(DSO)) {
-		if (al.map && al.map->dso && al.map->dso->name)
-			dsoname = al.map->dso->name;
-		else
-			dsoname = "";
-
-		printf(" (%s)", dsoname);
+		printf(" (");
+		map__print_dsoname(al.map);
+		printf(")");
 	}
 }
 
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index a16ecab..dddc0f3 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -200,6 +200,18 @@ size_t map__fprintf(struct map *self, FILE *fp)
 		       self->start, self->end, self->pgoff, self->dso->name);
 }
 
+void map__print_dsoname(struct map *self)
+{
+	const char *dsoname;
+
+	if (self && self->dso && self->dso->name)
+			dsoname = self->dso->name;
+	else
+		dsoname = "[unknown]";
+
+	printf("%s", dsoname);
+}
+
 /*
  * objdump wants/reports absolute IPs for ET_EXEC, and RIPs for ET_DYN.
  * map->dso->adjust_symbols==1 for ET_EXEC-like cases.
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index b397c03..6f452b9 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -112,6 +112,7 @@ void map__delete(struct map *self);
 struct map *map__clone(struct map *self);
 int map__overlap(struct map *l, struct map *r);
 size_t map__fprintf(struct map *self, FILE *fp);
+void map__print_dsoname(struct map *self);
 
 int map__load(struct map *self, symbol_filter_t filter);
 struct symbol *map__find_symbol(struct map *self,
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 453a010..442be3a 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1214,7 +1214,6 @@ void perf_session__print_ip(union perf_event *event,
 			    int print_sym, int print_dso)
 {
 	struct addr_location al;
-	const char *symname, *dsoname;
 	struct callchain_cursor *cursor = &session->callchain_cursor;
 	struct callchain_cursor_node *node;
 
@@ -1242,20 +1241,13 @@ void perf_session__print_ip(union perf_event *event,
 
 			printf("\t%16" PRIx64, node->ip);
 			if (print_sym) {
-				if (node->sym && node->sym->name)
-					symname = node->sym->name;
-				else
-					symname = "";
-
-				printf(" %s", symname);
+				printf(" ");
+				symbol__print_symname(node->sym);
 			}
 			if (print_dso) {
-				if (node->map && node->map->dso && node->map->dso->name)
-					dsoname = node->map->dso->name;
-				else
-					dsoname = "";
-
-				printf(" (%s)", dsoname);
+				printf(" (");
+				map__print_dsoname(al.map);
+				printf(")");
 			}
 			printf("\n");
 
@@ -1265,21 +1257,14 @@ void perf_session__print_ip(union perf_event *event,
 	} else {
 		printf("%16" PRIx64, sample->ip);
 		if (print_sym) {
-			if (al.sym && al.sym->name)
-				symname = al.sym->name;
-			else
-				symname = "";
-
-			printf(" %s", symname);
+			printf(" ");
+			symbol__print_symname(al.sym);
 		}
 
 		if (print_dso) {
-			if (al.map && al.map->dso && al.map->dso->name)
-				dsoname = al.map->dso->name;
-			else
-				dsoname = "";
-
-			printf(" (%s)", dsoname);
+			printf(" (");
+			map__print_dsoname(al.map);
+			printf(")");
 		}
 	}
 }
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index eec1963..85e19c4 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -175,6 +175,18 @@ static size_t symbol__fprintf(struct symbol *sym, FILE *fp)
 		       sym->name);
 }
 
+void symbol__print_symname(const struct symbol *sym)
+{
+	const char *symname;
+
+	if (sym && sym->name)
+		symname = sym->name;
+	else
+		symname = "(unknown)";
+
+	printf("%s", symname);
+}
+
 void dso__set_long_name(struct dso *dso, char *name)
 {
 	if (name == NULL)
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 325ee36..1ec17b4 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -238,6 +238,7 @@ void machines__destroy_guest_kernel_maps(struct rb_root *machines);
 
 int symbol__init(void);
 void symbol__exit(void);
+void symbol__print_symname(const struct symbol *sym);
 bool symbol_type__is_a(char symbol_type, enum map_type map_type);
 
 size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH -tip v2 3/6] perf script: resolve DSOs and symbols for user-space
  2011-07-17  9:30 [PATCH -tip v2 0/6] perf script: add BTS analysis features Akihiro Nagai
  2011-07-17  9:30 ` [PATCH -tip v2 1/6] [BUGFIX] perf script: print correct IP address Akihiro Nagai
  2011-07-17  9:30 ` [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols Akihiro Nagai
@ 2011-07-17  9:30 ` Akihiro Nagai
  2011-07-17 16:20   ` David Ahern
  2011-07-17  9:31 ` [PATCH -tip v2 4/6] perf script: print DSOs and symbols for BTS branch_from addr Akihiro Nagai
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-17  9:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, David Ahern
  Cc: linux-kernel, Masami Hiramatsu, yrl.pp-manager.tt, Akihiro Nagai,
	Peter Zijlstra, Frederic Weisbecker, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, David Ahern, Masami Hiramatsu

Resolve user-space DSOs and symbols.
Latest perf-script can resolve DSOs and symbols for only kernel
and kernel modules. This patch resolves them for other
executable binaries.

# perf script -f ip,addr,sym,dso
3f03e016b0 ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e016b0 ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e04b80       3f03e016b3 _start (/lib64/ld-2.14.so)
3f03e04b80 ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e04ba6 ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e04bad ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e04c1d       3f03e04bfb _dl_start (/lib64/ld-2.14.so)
3f03e04c00       3f03e04c21 _dl_start (/lib64/ld-2.14.so)
3f03e04c00       3f03e04c21 _dl_start (/lib64/ld-2.14.so)
[snip]

Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---

 tools/perf/builtin-script.c |    4 ++++
 tools/perf/util/event.c     |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index b3e0951..2356198 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -328,6 +328,10 @@ static void print_sample_addr(union perf_event *event,
 
 	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
 			      event->ip.pid, sample->addr, &al);
+	/* try to resolve for user space */
+	if (!al.map)
+		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
+			MAP__FUNCTION, event->ip.pid, sample->addr, &al);
 	if (!al.map)
 		thread__find_addr_map(thread, session, cpumode, MAP__VARIABLE,
 				      event->ip.pid, sample->addr, &al);
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 3c1b8a6..49a9315 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -771,6 +771,11 @@ int perf_event__preprocess_sample(const union perf_event *event,
 
 	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
 			      event->ip.pid, event->ip.ip, al);
+	/* try to resolve for user space */
+	if (!al->map)
+		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
+				MAP__FUNCTION, event->ip.pid, event->ip.ip, al);
+
 	dump_printf(" ...... dso: %s\n",
 		    al->map ? al->map->dso->long_name :
 			al->level == 'H' ? "[hypervisor]" : "<not found>");


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH -tip v2 4/6] perf script: print DSOs and symbols for BTS branch_from addr
  2011-07-17  9:30 [PATCH -tip v2 0/6] perf script: add BTS analysis features Akihiro Nagai
                   ` (2 preceding siblings ...)
  2011-07-17  9:30 ` [PATCH -tip v2 3/6] perf script: resolve DSOs and symbols for user-space Akihiro Nagai
@ 2011-07-17  9:31 ` Akihiro Nagai
  2011-07-17 16:22   ` David Ahern
  2011-07-17  9:31 ` [PATCH -tip v2 5/6] perf script: add the offset field specifier Akihiro Nagai
  2011-07-17  9:31 ` [PATCH -tip v2 6/6] perf script: add option resolving vmlinux path Akihiro Nagai
  5 siblings, 1 reply; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-17  9:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, David Ahern
  Cc: linux-kernel, Masami Hiramatsu, yrl.pp-manager.tt, Akihiro Nagai,
	Peter Zijlstra, Frederic Weisbecker, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, David Ahern, Masami Hiramatsu

Print DSOs and symbols for branch_from address of BTS.
BTS records branch_from address in 'addr' fields,
and branch_to address in 'ip' field. Latest perf-script
resolves DSOs and symbols only for 'ip' field.
This patch resolves them for 'addr' field too.

# perf script -f ip,addr,dso,sym
3f03e016b0 (unknown) ([kernel.kallsyms]) ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e016b0    _start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e04b80 _dl_start (/lib64/ld-2.14.so)       3f03e016b3 _start (/lib64/ld-2.14.so)
3f03e04b80 _dl_start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e04ba6 _dl_start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e04bad _dl_start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
3f03e04c1d _dl_start (/lib64/ld-2.14.so)       3f03e04bfb _dl_start (/lib64/ld-2.14.so)
[snip]

Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---

 tools/perf/builtin-script.c |    8 +++++++-
 tools/perf/util/event.c     |    2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 2356198..7708d89 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -309,6 +309,12 @@ static bool sample_addr_correlates_sym(struct perf_event_attr *attr)
 	     (attr->config == PERF_COUNT_SW_PAGE_FAULTS_MAJ)))
 		return true;
 
+	/* BTS Events */
+	if ((attr->type == PERF_TYPE_HARDWARE) &&
+	    (attr->config & PERF_COUNT_HW_BRANCH_INSTRUCTIONS) &&
+	    (attr->sample_period == 1))
+		return true;
+
 	return false;
 }
 
@@ -328,7 +334,7 @@ static void print_sample_addr(union perf_event *event,
 
 	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
 			      event->ip.pid, sample->addr, &al);
-	/* try to resolve for user space */
+	/* try to resolve addr_location for user space */
 	if (!al.map)
 		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
 			MAP__FUNCTION, event->ip.pid, sample->addr, &al);
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 49a9315..c541d02 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -771,7 +771,7 @@ int perf_event__preprocess_sample(const union perf_event *event,
 
 	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
 			      event->ip.pid, event->ip.ip, al);
-	/* try to resolve for user space */
+	/* try to resolve addr_location for user space */
 	if (!al->map)
 		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
 				MAP__FUNCTION, event->ip.pid, event->ip.ip, al);


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH -tip v2 5/6] perf script: add the offset field specifier
  2011-07-17  9:30 [PATCH -tip v2 0/6] perf script: add BTS analysis features Akihiro Nagai
                   ` (3 preceding siblings ...)
  2011-07-17  9:31 ` [PATCH -tip v2 4/6] perf script: print DSOs and symbols for BTS branch_from addr Akihiro Nagai
@ 2011-07-17  9:31 ` Akihiro Nagai
  2011-07-17 16:28   ` David Ahern
  2011-07-17  9:31 ` [PATCH -tip v2 6/6] perf script: add option resolving vmlinux path Akihiro Nagai
  5 siblings, 1 reply; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-17  9:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, David Ahern
  Cc: linux-kernel, Masami Hiramatsu, yrl.pp-manager.tt, Akihiro Nagai,
	Peter Zijlstra, Frederic Weisbecker, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, David Ahern, Masami Hiramatsu

Add the offset field specifier 'offs' to show the offset from
the symbols in the output of perf-script. We can get the more
detailed address information.

Output sample:
# perf script -f ip,addr,sym,offs
301ec016b0             (unknown) ffffffff81467612 irq_return+0x0
301ec016b0            _start+0x0 ffffffff81467612 irq_return+0x0
301ec04b70         _dl_start+0x0       301ec016b3 _start+0x3
301ec04b70         _dl_start+0x0 ffffffff81467612 irq_return+0x0
301ec04b96        _dl_start+0x26 ffffffff81467612 irq_return+0x0
301ec04b9d        _dl_start+0x2d ffffffff81467612 irq_return+0x0
301ec04c0d        _dl_start+0x9d       301ec04beb _dl_start+0x7b
301ec04bf0        _dl_start+0x80       301ec04c11 _dl_start+0xa1
[snip]

Changes in v2:
 - change the way to output offset from '--show-symbol-offset' to
   'offs' field.
 - clean up codes.

Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---

 tools/perf/Documentation/perf-script.txt |    2 +-
 tools/perf/builtin-script.c              |   20 +++++++++++++++++---
 tools/perf/util/session.c                |    7 +++++--
 tools/perf/util/session.h                |    3 ++-
 tools/perf/util/symbol.c                 |   22 +++++++++++++++-------
 tools/perf/util/symbol.h                 |    2 ++
 6 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index db01786..ee4d477 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -115,7 +115,7 @@ OPTIONS
 -f::
 --fields::
         Comma separated list of fields to print. Options are:
-        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr.
+        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, offs.
         Field list can be prepended with the type, trace, sw or hw,
         to indicate to which event type the field list applies.
         e.g., -f sw:comm,tid,time,ip,sym  and -f trace:time,cpu,trace
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 7708d89..fd68185 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -37,6 +37,7 @@ enum perf_output_field {
 	PERF_OUTPUT_SYM             = 1U << 8,
 	PERF_OUTPUT_DSO             = 1U << 9,
 	PERF_OUTPUT_ADDR            = 1U << 10,
+	PERF_OUTPUT_OFFSET          = 1U << 11,
 };
 
 struct output_option {
@@ -54,6 +55,7 @@ struct output_option {
 	{.str = "sym",   .field = PERF_OUTPUT_SYM},
 	{.str = "dso",   .field = PERF_OUTPUT_DSO},
 	{.str = "addr",  .field = PERF_OUTPUT_ADDR},
+	{.str = "offs",  .field = PERF_OUTPUT_OFFSET},
 };
 
 /* default set to maintain compatibility with current format */
@@ -190,6 +192,11 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
 		       "to symbols.\n");
 		return -EINVAL;
 	}
+	if (PRINT_FIELD(OFFSET) && !PRINT_FIELD(SYM)) {
+		pr_err("Display of offsets requested but symbol is not"
+		       "selected.\n");
+		return -EINVAL;
+	}
 	if (PRINT_FIELD(DSO) && !PRINT_FIELD(IP) && !PRINT_FIELD(ADDR)) {
 		pr_err("Display of DSO requested but neither sample IP nor "
 			   "sample address\nis selected. Hence, no addresses to convert "
@@ -350,7 +357,10 @@ static void print_sample_addr(union perf_event *event,
 
 	if (PRINT_FIELD(SYM)) {
 		printf(" ");
-		symbol__print_symname(al.sym);
+		if (PRINT_FIELD(OFFSET))
+			symbol__print_symname_offs(al.sym, &al);
+		else
+			symbol__print_symname(al.sym);
 	}
 
 	if (PRINT_FIELD(DSO)) {
@@ -386,7 +396,8 @@ static void process_event(union perf_event *event __unused,
 		else
 			printf("\n");
 		perf_session__print_ip(event, sample, session,
-					      PRINT_FIELD(SYM), PRINT_FIELD(DSO));
+				       PRINT_FIELD(SYM), PRINT_FIELD(DSO),
+				       PRINT_FIELD(OFFSET));
 	}
 
 	printf("\n");
@@ -1082,7 +1093,10 @@ static const struct option options[] = {
 	OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
 		    "Look for files with symbols relative to this directory"),
 	OPT_CALLBACK('f', "fields", NULL, "str",
-		     "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr",
+		     "comma separated output fields prepend with 'type:'. "
+		     "Valid types: hw,sw,trace,raw. "
+		     "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,"
+		     "addr,offs",
 		     parse_output_fields),
 	OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
 
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 442be3a..3728e67 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1211,7 +1211,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
 void perf_session__print_ip(union perf_event *event,
 			    struct perf_sample *sample,
 			    struct perf_session *session,
-			    int print_sym, int print_dso)
+			    int print_sym, int print_dso, int print_offset)
 {
 	struct addr_location al;
 	struct callchain_cursor *cursor = &session->callchain_cursor;
@@ -1258,7 +1258,10 @@ void perf_session__print_ip(union perf_event *event,
 		printf("%16" PRIx64, sample->ip);
 		if (print_sym) {
 			printf(" ");
-			symbol__print_symname(al.sym);
+			if (print_offset)
+				symbol__print_symname_offs(al.sym, &al);
+			else
+				symbol__print_symname(al.sym);
 		}
 
 		if (print_dso) {
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 5de754f..e6e5586 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -170,7 +170,8 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
 void perf_session__print_ip(union perf_event *event,
 				 struct perf_sample *sample,
 				 struct perf_session *session,
-				 int print_sym, int print_dso);
+				 int print_sym, int print_dso,
+				 int print_offset);
 
 int perf_session__cpu_bitmap(struct perf_session *session,
 			     const char *cpu_list, unsigned long *cpu_bitmap);
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 85e19c4..abfecf6 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -175,16 +175,24 @@ static size_t symbol__fprintf(struct symbol *sym, FILE *fp)
 		       sym->name);
 }
 
-void symbol__print_symname(const struct symbol *sym)
+void symbol__print_symname_offs(const struct symbol *sym,
+				const struct addr_location *al)
 {
-	const char *symname;
+	unsigned long offset;
 
-	if (sym && sym->name)
-		symname = sym->name;
-	else
-		symname = "(unknown)";
+	if (sym && sym->name) {
+		printf("%s", sym->name);
+		if (al) {
+			offset = al->addr - sym->start;
+			printf("+0x%lx", offset);
+		}
+	} else
+		printf("(unknown)");
+}
 
-	printf("%s", symname);
+void symbol__print_symname(const struct symbol *sym)
+{
+	symbol__print_symname_offs(sym, NULL);
 }
 
 void dso__set_long_name(struct dso *dso, char *name)
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 1ec17b4..554b2fe 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -238,6 +238,8 @@ void machines__destroy_guest_kernel_maps(struct rb_root *machines);
 
 int symbol__init(void);
 void symbol__exit(void);
+void symbol__print_symname_offs(const struct symbol *sym,
+				const struct addr_location *al);
 void symbol__print_symname(const struct symbol *sym);
 bool symbol_type__is_a(char symbol_type, enum map_type map_type);
 


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH -tip v2 6/6] perf script: add option resolving vmlinux path
  2011-07-17  9:30 [PATCH -tip v2 0/6] perf script: add BTS analysis features Akihiro Nagai
                   ` (4 preceding siblings ...)
  2011-07-17  9:31 ` [PATCH -tip v2 5/6] perf script: add the offset field specifier Akihiro Nagai
@ 2011-07-17  9:31 ` Akihiro Nagai
  2011-07-17 16:36   ` David Ahern
  5 siblings, 1 reply; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-17  9:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, David Ahern
  Cc: linux-kernel, Masami Hiramatsu, yrl.pp-manager.tt, Akihiro Nagai,
	Peter Zijlstra, Frederic Weisbecker, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, David Ahern, Masami Hiramatsu

Add the option get the path of [kernel.kallsyms].
Specify '--show-kernel-path' option to use this function.
This patch enables other applications to use this output easily.

Without --show-kernel-path  option

# perf script -f ip,dso
ffffffff81467612 irq_return ([kernel.kallsyms])
ffffffff81467612 irq_return ([kernel.kallsyms])
    7f24fc02a6b3 _start (/lib64/ld-2.14.so)
[snip]

With --show-kernel-path option

# perf script -f ip,dso --show-kernel-path
ffffffff81467612 irq_return (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
ffffffff81467612 irq_return (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
    7f24fc02a6b3 _start (/lib64/ld-2.14.so)
[snip]

Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---

 tools/perf/Documentation/perf-script.txt |    3 +++
 tools/perf/builtin-script.c              |    2 ++
 tools/perf/util/map.c                    |    7 +++++--
 tools/perf/util/session.c                |    2 ++
 tools/perf/util/symbol.c                 |    1 +
 tools/perf/util/symbol.h                 |    1 +
 6 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index ee4d477..5383671 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -188,6 +188,9 @@ OPTIONS
 	CPUs are specified with -: 0-2. Default is to report samples on all
 	CPUs.
 
+--show-kernel-path::
+	Try to resolve the path of [kernel.kallsyms]
+
 SEE ALSO
 --------
 linkperf:perf-record[1], linkperf:perf-script-perl[1],
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index fd68185..0d04788 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1099,6 +1099,8 @@ static const struct option options[] = {
 		     "addr,offs",
 		     parse_output_fields),
 	OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
+	OPT_BOOLEAN('\0', "show-kernel-path", &show_kernel_path,
+		    "Show the path of [kernel.kallsyms]"),
 
 	OPT_END()
 };
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index dddc0f3..1645967 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -204,9 +204,12 @@ void map__print_dsoname(struct map *self)
 {
 	const char *dsoname;
 
-	if (self && self->dso && self->dso->name)
+	if (self && self->dso && (self->dso->name || self->dso->long_name)) {
+		if (show_kernel_path && self->dso->long_name)
+			dsoname = self->dso->long_name;
+		else if (self->dso->name)
 			dsoname = self->dso->name;
-	else
+	} else
 		dsoname = "[unknown]";
 
 	printf("%s", dsoname);
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 3728e67..34c5887 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -14,6 +14,8 @@
 #include "util.h"
 #include "cpumap.h"
 
+bool show_kernel_path;
+
 static int perf_session__open(struct perf_session *self, bool force)
 {
 	struct stat input_stat;
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index abfecf6..3356d6e 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -41,6 +41,7 @@ static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map,
 			symbol_filter_t filter);
 static int vmlinux_path__nr_entries;
 static char **vmlinux_path;
+bool show_kernel_path;
 
 struct symbol_conf symbol_conf = {
 	.exclude_other	  = true,
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 554b2fe..88000e5 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -96,6 +96,7 @@ struct symbol_conf {
 };
 
 extern struct symbol_conf symbol_conf;
+extern bool show_kernel_path;
 
 static inline void *symbol__priv(struct symbol *sym)
 {


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 1/6] [BUGFIX] perf script: print correct IP address
  2011-07-17  9:30 ` [PATCH -tip v2 1/6] [BUGFIX] perf script: print correct IP address Akihiro Nagai
@ 2011-07-17 15:59   ` David Ahern
  2011-07-17 17:29     ` Frederic Weisbecker
  0 siblings, 1 reply; 22+ messages in thread
From: David Ahern @ 2011-07-17 15:59 UTC (permalink / raw)
  To: Akihiro Nagai
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

On 07/17/2011 03:30 AM, Akihiro Nagai wrote:
> perf_session_print_ip() prints addr_location->addr as IP address.
> It's not always same as IP address. To correct it, this function
> must print sample->ip.
> 
> Changes in v2:
>  - add this patch

I submitted a patch for this back in May that was not picked up:
https://lkml.org/lkml/2011/5/30/223

David


> 
> Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> ---
> 
>  tools/perf/util/session.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index 080e533..453a010 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -1263,7 +1263,7 @@ void perf_session__print_ip(union perf_event *event,
>  		}
>  
>  	} else {
> -		printf("%16" PRIx64, al.addr);
> +		printf("%16" PRIx64, sample->ip);
>  		if (print_sym) {
>  			if (al.sym && al.sym->name)
>  				symname = al.sym->name;
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols
  2011-07-17  9:30 ` [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols Akihiro Nagai
@ 2011-07-17 16:07   ` David Ahern
  2011-07-17 16:30     ` David Ahern
  0 siblings, 1 reply; 22+ messages in thread
From: David Ahern @ 2011-07-17 16:07 UTC (permalink / raw)
  To: Akihiro Nagai
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras



On 07/17/2011 03:30 AM, Akihiro Nagai wrote:
> Latest perf-script doesn't output symbol name when it failed to
> resolve symbol name. This output is not friendly for external scripts
> because it causes misaligment. So, this patch adds the magic word
> "(unknown)" when perf-script failed to resolve symbols.

Code has [unknown] with {}, not ().

> 
> At the same time, this patch changes perf-script to output "[unknown]"
> in the DSO field, when it failed to resolve the path of DSOs.
> 
> Changes in v2:
>  - add this patch
> 
> Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> ---
> 
>  tools/perf/builtin-script.c |   18 +++++-------------
>  tools/perf/util/map.c       |   12 ++++++++++++
>  tools/perf/util/map.h       |    1 +
>  tools/perf/util/session.c   |   35 ++++++++++-------------------------
>  tools/perf/util/symbol.c    |   12 ++++++++++++
>  tools/perf/util/symbol.h    |    1 +
>  6 files changed, 41 insertions(+), 38 deletions(-)
> 
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 09024ec..b3e0951 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -320,7 +320,6 @@ static void print_sample_addr(union perf_event *event,
>  {
>  	struct addr_location al;
>  	u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
> -	const char *symname, *dsoname;
>  
>  	printf("%16" PRIx64, sample->addr);
>  
> @@ -340,21 +339,14 @@ static void print_sample_addr(union perf_event *event,
>  		al.sym = map__find_symbol(al.map, al.addr, NULL);
>  
>  	if (PRINT_FIELD(SYM)) {
> -		if (al.sym && al.sym->name)
> -			symname = al.sym->name;
> -		else
> -			symname = "";
> -
> -		printf(" %16s", symname);
> +		printf(" ");
> +		symbol__print_symname(al.sym);
>  	}
>  
>  	if (PRINT_FIELD(DSO)) {
> -		if (al.map && al.map->dso && al.map->dso->name)
> -			dsoname = al.map->dso->name;
> -		else
> -			dsoname = "";
> -
> -		printf(" (%s)", dsoname);
> +		printf(" (");
> +		map__print_dsoname(al.map);
> +		printf(")");
>  	}
>  }
>  
> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
> index a16ecab..dddc0f3 100644
> --- a/tools/perf/util/map.c
> +++ b/tools/perf/util/map.c
> @@ -200,6 +200,18 @@ size_t map__fprintf(struct map *self, FILE *fp)
>  		       self->start, self->end, self->pgoff, self->dso->name);
>  }
>  
> +void map__print_dsoname(struct map *self)
> +{
> +	const char *dsoname;
> +
> +	if (self && self->dso && self->dso->name)
> +			dsoname = self->dso->name;

extra tab in the above line.

Otherwise looks good to me.

Acked-By: dsahern@gmail.com

> +	else
> +		dsoname = "[unknown]";
> +
> +	printf("%s", dsoname);
> +}
> +
>  /*
>   * objdump wants/reports absolute IPs for ET_EXEC, and RIPs for ET_DYN.
>   * map->dso->adjust_symbols==1 for ET_EXEC-like cases.
> diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
> index b397c03..6f452b9 100644
> --- a/tools/perf/util/map.h
> +++ b/tools/perf/util/map.h
> @@ -112,6 +112,7 @@ void map__delete(struct map *self);
>  struct map *map__clone(struct map *self);
>  int map__overlap(struct map *l, struct map *r);
>  size_t map__fprintf(struct map *self, FILE *fp);
> +void map__print_dsoname(struct map *self);
>  
>  int map__load(struct map *self, symbol_filter_t filter);
>  struct symbol *map__find_symbol(struct map *self,
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index 453a010..442be3a 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -1214,7 +1214,6 @@ void perf_session__print_ip(union perf_event *event,
>  			    int print_sym, int print_dso)
>  {
>  	struct addr_location al;
> -	const char *symname, *dsoname;
>  	struct callchain_cursor *cursor = &session->callchain_cursor;
>  	struct callchain_cursor_node *node;
>  
> @@ -1242,20 +1241,13 @@ void perf_session__print_ip(union perf_event *event,
>  
>  			printf("\t%16" PRIx64, node->ip);
>  			if (print_sym) {
> -				if (node->sym && node->sym->name)
> -					symname = node->sym->name;
> -				else
> -					symname = "";
> -
> -				printf(" %s", symname);
> +				printf(" ");
> +				symbol__print_symname(node->sym);
>  			}
>  			if (print_dso) {
> -				if (node->map && node->map->dso && node->map->dso->name)
> -					dsoname = node->map->dso->name;
> -				else
> -					dsoname = "";
> -
> -				printf(" (%s)", dsoname);
> +				printf(" (");
> +				map__print_dsoname(al.map);
> +				printf(")");
>  			}
>  			printf("\n");
>  
> @@ -1265,21 +1257,14 @@ void perf_session__print_ip(union perf_event *event,
>  	} else {
>  		printf("%16" PRIx64, sample->ip);
>  		if (print_sym) {
> -			if (al.sym && al.sym->name)
> -				symname = al.sym->name;
> -			else
> -				symname = "";
> -
> -			printf(" %s", symname);
> +			printf(" ");
> +			symbol__print_symname(al.sym);
>  		}
>  
>  		if (print_dso) {
> -			if (al.map && al.map->dso && al.map->dso->name)
> -				dsoname = al.map->dso->name;
> -			else
> -				dsoname = "";
> -
> -			printf(" (%s)", dsoname);
> +			printf(" (");
> +			map__print_dsoname(al.map);
> +			printf(")");
>  		}
>  	}
>  }
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index eec1963..85e19c4 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -175,6 +175,18 @@ static size_t symbol__fprintf(struct symbol *sym, FILE *fp)
>  		       sym->name);
>  }
>  
> +void symbol__print_symname(const struct symbol *sym)
> +{
> +	const char *symname;
> +
> +	if (sym && sym->name)
> +		symname = sym->name;
> +	else
> +		symname = "(unknown)";
> +
> +	printf("%s", symname);
> +}
> +
>  void dso__set_long_name(struct dso *dso, char *name)
>  {
>  	if (name == NULL)
> diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
> index 325ee36..1ec17b4 100644
> --- a/tools/perf/util/symbol.h
> +++ b/tools/perf/util/symbol.h
> @@ -238,6 +238,7 @@ void machines__destroy_guest_kernel_maps(struct rb_root *machines);
>  
>  int symbol__init(void);
>  void symbol__exit(void);
> +void symbol__print_symname(const struct symbol *sym);
>  bool symbol_type__is_a(char symbol_type, enum map_type map_type);
>  
>  size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 3/6] perf script: resolve DSOs and symbols for user-space
  2011-07-17  9:30 ` [PATCH -tip v2 3/6] perf script: resolve DSOs and symbols for user-space Akihiro Nagai
@ 2011-07-17 16:20   ` David Ahern
  2011-07-21  9:36     ` Akihiro Nagai
  0 siblings, 1 reply; 22+ messages in thread
From: David Ahern @ 2011-07-17 16:20 UTC (permalink / raw)
  To: Akihiro Nagai
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

On 07/17/2011 03:30 AM, Akihiro Nagai wrote:
> Resolve user-space DSOs and symbols.
> Latest perf-script can resolve DSOs and symbols for only kernel
> and kernel modules. This patch resolves them for other
> executable binaries.

The description is a bit misleading. perf script does resolve symbols
for userspace. e.g., the example in the bug fix I submitted in May:
https://lkml.org/lkml/2011/5/30/223

Do you look into why the cpumode setting is not working that you have to
try specific settings?

David


> 
> # perf script -f ip,addr,sym,dso
> 3f03e016b0 ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e016b0 ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e04b80       3f03e016b3 _start (/lib64/ld-2.14.so)
> 3f03e04b80 ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e04ba6 ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e04bad ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e04c1d       3f03e04bfb _dl_start (/lib64/ld-2.14.so)
> 3f03e04c00       3f03e04c21 _dl_start (/lib64/ld-2.14.so)
> 3f03e04c00       3f03e04c21 _dl_start (/lib64/ld-2.14.so)
> [snip]
> 
> Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> ---
> 
>  tools/perf/builtin-script.c |    4 ++++
>  tools/perf/util/event.c     |    5 +++++
>  2 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index b3e0951..2356198 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -328,6 +328,10 @@ static void print_sample_addr(union perf_event *event,
>  
>  	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
>  			      event->ip.pid, sample->addr, &al);
> +	/* try to resolve for user space */
> +	if (!al.map)
> +		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
> +			MAP__FUNCTION, event->ip.pid, sample->addr, &al);
>  	if (!al.map)
>  		thread__find_addr_map(thread, session, cpumode, MAP__VARIABLE,
>  				      event->ip.pid, sample->addr, &al);
> diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
> index 3c1b8a6..49a9315 100644
> --- a/tools/perf/util/event.c
> +++ b/tools/perf/util/event.c
> @@ -771,6 +771,11 @@ int perf_event__preprocess_sample(const union perf_event *event,
>  
>  	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
>  			      event->ip.pid, event->ip.ip, al);
> +	/* try to resolve for user space */
> +	if (!al->map)
> +		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
> +				MAP__FUNCTION, event->ip.pid, event->ip.ip, al);
> +
>  	dump_printf(" ...... dso: %s\n",
>  		    al->map ? al->map->dso->long_name :
>  			al->level == 'H' ? "[hypervisor]" : "<not found>");
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 4/6] perf script: print DSOs and symbols for BTS branch_from addr
  2011-07-17  9:31 ` [PATCH -tip v2 4/6] perf script: print DSOs and symbols for BTS branch_from addr Akihiro Nagai
@ 2011-07-17 16:22   ` David Ahern
  2011-07-21  9:36     ` Akihiro Nagai
  0 siblings, 1 reply; 22+ messages in thread
From: David Ahern @ 2011-07-17 16:22 UTC (permalink / raw)
  To: Akihiro Nagai
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras



On 07/17/2011 03:31 AM, Akihiro Nagai wrote:
> Print DSOs and symbols for branch_from address of BTS.
> BTS records branch_from address in 'addr' fields,
> and branch_to address in 'ip' field. Latest perf-script
> resolves DSOs and symbols only for 'ip' field.
> This patch resolves them for 'addr' field too.

Description does not match code change. What you are doing is enhancing
the detection of when a sample address should correlate to a symbol. In
this case you are adding HW_BRANCH_INSTRUCTIONS event.

David


> 
> # perf script -f ip,addr,dso,sym
> 3f03e016b0 (unknown) ([kernel.kallsyms]) ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e016b0    _start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e04b80 _dl_start (/lib64/ld-2.14.so)       3f03e016b3 _start (/lib64/ld-2.14.so)
> 3f03e04b80 _dl_start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e04ba6 _dl_start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e04bad _dl_start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
> 3f03e04c1d _dl_start (/lib64/ld-2.14.so)       3f03e04bfb _dl_start (/lib64/ld-2.14.so)
> [snip]
> 
> Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> ---
> 
>  tools/perf/builtin-script.c |    8 +++++++-
>  tools/perf/util/event.c     |    2 +-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 2356198..7708d89 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -309,6 +309,12 @@ static bool sample_addr_correlates_sym(struct perf_event_attr *attr)
>  	     (attr->config == PERF_COUNT_SW_PAGE_FAULTS_MAJ)))
>  		return true;
>  
> +	/* BTS Events */
> +	if ((attr->type == PERF_TYPE_HARDWARE) &&
> +	    (attr->config & PERF_COUNT_HW_BRANCH_INSTRUCTIONS) &&
> +	    (attr->sample_period == 1))
> +		return true;
> +
>  	return false;
>  }
>  
> @@ -328,7 +334,7 @@ static void print_sample_addr(union perf_event *event,
>  
>  	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
>  			      event->ip.pid, sample->addr, &al);
> -	/* try to resolve for user space */
> +	/* try to resolve addr_location for user space */
>  	if (!al.map)
>  		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
>  			MAP__FUNCTION, event->ip.pid, sample->addr, &al);
> diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
> index 49a9315..c541d02 100644
> --- a/tools/perf/util/event.c
> +++ b/tools/perf/util/event.c
> @@ -771,7 +771,7 @@ int perf_event__preprocess_sample(const union perf_event *event,
>  
>  	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
>  			      event->ip.pid, event->ip.ip, al);
> -	/* try to resolve for user space */
> +	/* try to resolve addr_location for user space */
>  	if (!al->map)
>  		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
>  				MAP__FUNCTION, event->ip.pid, event->ip.ip, al);
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 5/6] perf script: add the offset field specifier
  2011-07-17  9:31 ` [PATCH -tip v2 5/6] perf script: add the offset field specifier Akihiro Nagai
@ 2011-07-17 16:28   ` David Ahern
  0 siblings, 0 replies; 22+ messages in thread
From: David Ahern @ 2011-07-17 16:28 UTC (permalink / raw)
  To: Akihiro Nagai
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras



On 07/17/2011 03:31 AM, Akihiro Nagai wrote:
> Add the offset field specifier 'offs' to show the offset from
> the symbols in the output of perf-script. We can get the more
> detailed address information.
> 
> Output sample:
> # perf script -f ip,addr,sym,offs
> 301ec016b0             (unknown) ffffffff81467612 irq_return+0x0
> 301ec016b0            _start+0x0 ffffffff81467612 irq_return+0x0
> 301ec04b70         _dl_start+0x0       301ec016b3 _start+0x3
> 301ec04b70         _dl_start+0x0 ffffffff81467612 irq_return+0x0
> 301ec04b96        _dl_start+0x26 ffffffff81467612 irq_return+0x0
> 301ec04b9d        _dl_start+0x2d ffffffff81467612 irq_return+0x0
> 301ec04c0d        _dl_start+0x9d       301ec04beb _dl_start+0x7b
> 301ec04bf0        _dl_start+0x80       301ec04c11 _dl_start+0xa1
> [snip]
> 
> Changes in v2:
>  - change the way to output offset from '--show-symbol-offset' to
>    'offs' field.
>  - clean up codes.

Looks ok to me.

Acked-By: David Ahern <dsahern@gmail.com>

David


> 
> Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> ---
> 
>  tools/perf/Documentation/perf-script.txt |    2 +-
>  tools/perf/builtin-script.c              |   20 +++++++++++++++++---
>  tools/perf/util/session.c                |    7 +++++--
>  tools/perf/util/session.h                |    3 ++-
>  tools/perf/util/symbol.c                 |   22 +++++++++++++++-------
>  tools/perf/util/symbol.h                 |    2 ++
>  6 files changed, 42 insertions(+), 14 deletions(-)
> 
> diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
> index db01786..ee4d477 100644
> --- a/tools/perf/Documentation/perf-script.txt
> +++ b/tools/perf/Documentation/perf-script.txt
> @@ -115,7 +115,7 @@ OPTIONS
>  -f::
>  --fields::
>          Comma separated list of fields to print. Options are:
> -        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr.
> +        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, offs.
>          Field list can be prepended with the type, trace, sw or hw,
>          to indicate to which event type the field list applies.
>          e.g., -f sw:comm,tid,time,ip,sym  and -f trace:time,cpu,trace
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 7708d89..fd68185 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -37,6 +37,7 @@ enum perf_output_field {
>  	PERF_OUTPUT_SYM             = 1U << 8,
>  	PERF_OUTPUT_DSO             = 1U << 9,
>  	PERF_OUTPUT_ADDR            = 1U << 10,
> +	PERF_OUTPUT_OFFSET          = 1U << 11,
>  };
>  
>  struct output_option {
> @@ -54,6 +55,7 @@ struct output_option {
>  	{.str = "sym",   .field = PERF_OUTPUT_SYM},
>  	{.str = "dso",   .field = PERF_OUTPUT_DSO},
>  	{.str = "addr",  .field = PERF_OUTPUT_ADDR},
> +	{.str = "offs",  .field = PERF_OUTPUT_OFFSET},
>  };
>  
>  /* default set to maintain compatibility with current format */
> @@ -190,6 +192,11 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
>  		       "to symbols.\n");
>  		return -EINVAL;
>  	}
> +	if (PRINT_FIELD(OFFSET) && !PRINT_FIELD(SYM)) {
> +		pr_err("Display of offsets requested but symbol is not"
> +		       "selected.\n");
> +		return -EINVAL;
> +	}
>  	if (PRINT_FIELD(DSO) && !PRINT_FIELD(IP) && !PRINT_FIELD(ADDR)) {
>  		pr_err("Display of DSO requested but neither sample IP nor "
>  			   "sample address\nis selected. Hence, no addresses to convert "
> @@ -350,7 +357,10 @@ static void print_sample_addr(union perf_event *event,
>  
>  	if (PRINT_FIELD(SYM)) {
>  		printf(" ");
> -		symbol__print_symname(al.sym);
> +		if (PRINT_FIELD(OFFSET))
> +			symbol__print_symname_offs(al.sym, &al);
> +		else
> +			symbol__print_symname(al.sym);
>  	}
>  
>  	if (PRINT_FIELD(DSO)) {
> @@ -386,7 +396,8 @@ static void process_event(union perf_event *event __unused,
>  		else
>  			printf("\n");
>  		perf_session__print_ip(event, sample, session,
> -					      PRINT_FIELD(SYM), PRINT_FIELD(DSO));
> +				       PRINT_FIELD(SYM), PRINT_FIELD(DSO),
> +				       PRINT_FIELD(OFFSET));
>  	}
>  
>  	printf("\n");
> @@ -1082,7 +1093,10 @@ static const struct option options[] = {
>  	OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
>  		    "Look for files with symbols relative to this directory"),
>  	OPT_CALLBACK('f', "fields", NULL, "str",
> -		     "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr",
> +		     "comma separated output fields prepend with 'type:'. "
> +		     "Valid types: hw,sw,trace,raw. "
> +		     "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,"
> +		     "addr,offs",
>  		     parse_output_fields),
>  	OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
>  
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index 442be3a..3728e67 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -1211,7 +1211,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
>  void perf_session__print_ip(union perf_event *event,
>  			    struct perf_sample *sample,
>  			    struct perf_session *session,
> -			    int print_sym, int print_dso)
> +			    int print_sym, int print_dso, int print_offset)
>  {
>  	struct addr_location al;
>  	struct callchain_cursor *cursor = &session->callchain_cursor;
> @@ -1258,7 +1258,10 @@ void perf_session__print_ip(union perf_event *event,
>  		printf("%16" PRIx64, sample->ip);
>  		if (print_sym) {
>  			printf(" ");
> -			symbol__print_symname(al.sym);
> +			if (print_offset)
> +				symbol__print_symname_offs(al.sym, &al);
> +			else
> +				symbol__print_symname(al.sym);
>  		}
>  
>  		if (print_dso) {
> diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
> index 5de754f..e6e5586 100644
> --- a/tools/perf/util/session.h
> +++ b/tools/perf/util/session.h
> @@ -170,7 +170,8 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
>  void perf_session__print_ip(union perf_event *event,
>  				 struct perf_sample *sample,
>  				 struct perf_session *session,
> -				 int print_sym, int print_dso);
> +				 int print_sym, int print_dso,
> +				 int print_offset);
>  
>  int perf_session__cpu_bitmap(struct perf_session *session,
>  			     const char *cpu_list, unsigned long *cpu_bitmap);
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index 85e19c4..abfecf6 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -175,16 +175,24 @@ static size_t symbol__fprintf(struct symbol *sym, FILE *fp)
>  		       sym->name);
>  }
>  
> -void symbol__print_symname(const struct symbol *sym)
> +void symbol__print_symname_offs(const struct symbol *sym,
> +				const struct addr_location *al)
>  {
> -	const char *symname;
> +	unsigned long offset;
>  
> -	if (sym && sym->name)
> -		symname = sym->name;
> -	else
> -		symname = "(unknown)";
> +	if (sym && sym->name) {
> +		printf("%s", sym->name);
> +		if (al) {
> +			offset = al->addr - sym->start;
> +			printf("+0x%lx", offset);
> +		}
> +	} else
> +		printf("(unknown)");
> +}
>  
> -	printf("%s", symname);
> +void symbol__print_symname(const struct symbol *sym)
> +{
> +	symbol__print_symname_offs(sym, NULL);
>  }
>  
>  void dso__set_long_name(struct dso *dso, char *name)
> diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
> index 1ec17b4..554b2fe 100644
> --- a/tools/perf/util/symbol.h
> +++ b/tools/perf/util/symbol.h
> @@ -238,6 +238,8 @@ void machines__destroy_guest_kernel_maps(struct rb_root *machines);
>  
>  int symbol__init(void);
>  void symbol__exit(void);
> +void symbol__print_symname_offs(const struct symbol *sym,
> +				const struct addr_location *al);
>  void symbol__print_symname(const struct symbol *sym);
>  bool symbol_type__is_a(char symbol_type, enum map_type map_type);
>  
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols
  2011-07-17 16:07   ` David Ahern
@ 2011-07-17 16:30     ` David Ahern
  2011-07-21  9:36       ` Akihiro Nagai
  0 siblings, 1 reply; 22+ messages in thread
From: David Ahern @ 2011-07-17 16:30 UTC (permalink / raw)
  To: Akihiro Nagai
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

On 07/17/2011 10:07 AM, David Ahern wrote:
> 
> 
> On 07/17/2011 03:30 AM, Akihiro Nagai wrote:
>> Latest perf-script doesn't output symbol name when it failed to
>> resolve symbol name. This output is not friendly for external scripts
>> because it causes misaligment. So, this patch adds the magic word
>> "(unknown)" when perf-script failed to resolve symbols.
> 
> Code has [unknown] with {}, not ().

Evidently I had the shift key down -- s/{}/[]/.  :-) And I see now, for
dsoname you have [unknown] and for symname (unknown). Use the same for
both. Since () is already used for separating dsoname, use [unknown] for
both

David


> 
>>
>> At the same time, this patch changes perf-script to output "[unknown]"
>> in the DSO field, when it failed to resolve the path of DSOs.
>>
>> Changes in v2:
>>  - add this patch
>>
>> Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Frederic Weisbecker <fweisbec@gmail.com>
>> Cc: Paul Mackerras <paulus@samba.org>
>> Cc: Ingo Molnar <mingo@elte.hu>
>> Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
>> Cc: David Ahern <dsahern@gmail.com>
>> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
>> ---
>>
>>  tools/perf/builtin-script.c |   18 +++++-------------
>>  tools/perf/util/map.c       |   12 ++++++++++++
>>  tools/perf/util/map.h       |    1 +
>>  tools/perf/util/session.c   |   35 ++++++++++-------------------------
>>  tools/perf/util/symbol.c    |   12 ++++++++++++
>>  tools/perf/util/symbol.h    |    1 +
>>  6 files changed, 41 insertions(+), 38 deletions(-)
>>
>> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
>> index 09024ec..b3e0951 100644
>> --- a/tools/perf/builtin-script.c
>> +++ b/tools/perf/builtin-script.c
>> @@ -320,7 +320,6 @@ static void print_sample_addr(union perf_event *event,
>>  {
>>  	struct addr_location al;
>>  	u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
>> -	const char *symname, *dsoname;
>>  
>>  	printf("%16" PRIx64, sample->addr);
>>  
>> @@ -340,21 +339,14 @@ static void print_sample_addr(union perf_event *event,
>>  		al.sym = map__find_symbol(al.map, al.addr, NULL);
>>  
>>  	if (PRINT_FIELD(SYM)) {
>> -		if (al.sym && al.sym->name)
>> -			symname = al.sym->name;
>> -		else
>> -			symname = "";
>> -
>> -		printf(" %16s", symname);
>> +		printf(" ");
>> +		symbol__print_symname(al.sym);
>>  	}
>>  
>>  	if (PRINT_FIELD(DSO)) {
>> -		if (al.map && al.map->dso && al.map->dso->name)
>> -			dsoname = al.map->dso->name;
>> -		else
>> -			dsoname = "";
>> -
>> -		printf(" (%s)", dsoname);
>> +		printf(" (");
>> +		map__print_dsoname(al.map);
>> +		printf(")");
>>  	}
>>  }
>>  
>> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
>> index a16ecab..dddc0f3 100644
>> --- a/tools/perf/util/map.c
>> +++ b/tools/perf/util/map.c
>> @@ -200,6 +200,18 @@ size_t map__fprintf(struct map *self, FILE *fp)
>>  		       self->start, self->end, self->pgoff, self->dso->name);
>>  }
>>  
>> +void map__print_dsoname(struct map *self)
>> +{
>> +	const char *dsoname;
>> +
>> +	if (self && self->dso && self->dso->name)
>> +			dsoname = self->dso->name;
> 
> extra tab in the above line.
> 
> Otherwise looks good to me.
> 
> Acked-By: dsahern@gmail.com
> 
>> +	else
>> +		dsoname = "[unknown]";
>> +
>> +	printf("%s", dsoname);
>> +}
>> +
>>  /*
>>   * objdump wants/reports absolute IPs for ET_EXEC, and RIPs for ET_DYN.
>>   * map->dso->adjust_symbols==1 for ET_EXEC-like cases.
>> diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
>> index b397c03..6f452b9 100644
>> --- a/tools/perf/util/map.h
>> +++ b/tools/perf/util/map.h
>> @@ -112,6 +112,7 @@ void map__delete(struct map *self);
>>  struct map *map__clone(struct map *self);
>>  int map__overlap(struct map *l, struct map *r);
>>  size_t map__fprintf(struct map *self, FILE *fp);
>> +void map__print_dsoname(struct map *self);
>>  
>>  int map__load(struct map *self, symbol_filter_t filter);
>>  struct symbol *map__find_symbol(struct map *self,
>> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
>> index 453a010..442be3a 100644
>> --- a/tools/perf/util/session.c
>> +++ b/tools/perf/util/session.c
>> @@ -1214,7 +1214,6 @@ void perf_session__print_ip(union perf_event *event,
>>  			    int print_sym, int print_dso)
>>  {
>>  	struct addr_location al;
>> -	const char *symname, *dsoname;
>>  	struct callchain_cursor *cursor = &session->callchain_cursor;
>>  	struct callchain_cursor_node *node;
>>  
>> @@ -1242,20 +1241,13 @@ void perf_session__print_ip(union perf_event *event,
>>  
>>  			printf("\t%16" PRIx64, node->ip);
>>  			if (print_sym) {
>> -				if (node->sym && node->sym->name)
>> -					symname = node->sym->name;
>> -				else
>> -					symname = "";
>> -
>> -				printf(" %s", symname);
>> +				printf(" ");
>> +				symbol__print_symname(node->sym);
>>  			}
>>  			if (print_dso) {
>> -				if (node->map && node->map->dso && node->map->dso->name)
>> -					dsoname = node->map->dso->name;
>> -				else
>> -					dsoname = "";
>> -
>> -				printf(" (%s)", dsoname);
>> +				printf(" (");
>> +				map__print_dsoname(al.map);
>> +				printf(")");
>>  			}
>>  			printf("\n");
>>  
>> @@ -1265,21 +1257,14 @@ void perf_session__print_ip(union perf_event *event,
>>  	} else {
>>  		printf("%16" PRIx64, sample->ip);
>>  		if (print_sym) {
>> -			if (al.sym && al.sym->name)
>> -				symname = al.sym->name;
>> -			else
>> -				symname = "";
>> -
>> -			printf(" %s", symname);
>> +			printf(" ");
>> +			symbol__print_symname(al.sym);
>>  		}
>>  
>>  		if (print_dso) {
>> -			if (al.map && al.map->dso && al.map->dso->name)
>> -				dsoname = al.map->dso->name;
>> -			else
>> -				dsoname = "";
>> -
>> -			printf(" (%s)", dsoname);
>> +			printf(" (");
>> +			map__print_dsoname(al.map);
>> +			printf(")");
>>  		}
>>  	}
>>  }
>> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
>> index eec1963..85e19c4 100644
>> --- a/tools/perf/util/symbol.c
>> +++ b/tools/perf/util/symbol.c
>> @@ -175,6 +175,18 @@ static size_t symbol__fprintf(struct symbol *sym, FILE *fp)
>>  		       sym->name);
>>  }
>>  
>> +void symbol__print_symname(const struct symbol *sym)
>> +{
>> +	const char *symname;
>> +
>> +	if (sym && sym->name)
>> +		symname = sym->name;
>> +	else
>> +		symname = "(unknown)";
>> +
>> +	printf("%s", symname);
>> +}
>> +
>>  void dso__set_long_name(struct dso *dso, char *name)
>>  {
>>  	if (name == NULL)
>> diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
>> index 325ee36..1ec17b4 100644
>> --- a/tools/perf/util/symbol.h
>> +++ b/tools/perf/util/symbol.h
>> @@ -238,6 +238,7 @@ void machines__destroy_guest_kernel_maps(struct rb_root *machines);
>>  
>>  int symbol__init(void);
>>  void symbol__exit(void);
>> +void symbol__print_symname(const struct symbol *sym);
>>  bool symbol_type__is_a(char symbol_type, enum map_type map_type);
>>  
>>  size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
>>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 6/6] perf script: add option resolving vmlinux path
  2011-07-17  9:31 ` [PATCH -tip v2 6/6] perf script: add option resolving vmlinux path Akihiro Nagai
@ 2011-07-17 16:36   ` David Ahern
  2011-07-21  9:36     ` Akihiro Nagai
  0 siblings, 1 reply; 22+ messages in thread
From: David Ahern @ 2011-07-17 16:36 UTC (permalink / raw)
  To: Akihiro Nagai
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

On 07/17/2011 03:31 AM, Akihiro Nagai wrote:
> Add the option get the path of [kernel.kallsyms].
> Specify '--show-kernel-path' option to use this function.
> This patch enables other applications to use this output easily.
> 
> Without --show-kernel-path  option
> 
> # perf script -f ip,dso
> ffffffff81467612 irq_return ([kernel.kallsyms])
> ffffffff81467612 irq_return ([kernel.kallsyms])
>     7f24fc02a6b3 _start (/lib64/ld-2.14.so)
> [snip]
> 
> With --show-kernel-path option
> 
> # perf script -f ip,dso --show-kernel-path
> ffffffff81467612 irq_return (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
> ffffffff81467612 irq_return (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
>     7f24fc02a6b3 _start (/lib64/ld-2.14.so)
> [snip]
> 
> Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> ---
> 
>  tools/perf/Documentation/perf-script.txt |    3 +++
>  tools/perf/builtin-script.c              |    2 ++
>  tools/perf/util/map.c                    |    7 +++++--
>  tools/perf/util/session.c                |    2 ++
>  tools/perf/util/symbol.c                 |    1 +
>  tools/perf/util/symbol.h                 |    1 +
>  6 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
> index ee4d477..5383671 100644
> --- a/tools/perf/Documentation/perf-script.txt
> +++ b/tools/perf/Documentation/perf-script.txt
> @@ -188,6 +188,9 @@ OPTIONS
>  	CPUs are specified with -: 0-2. Default is to report samples on all
>  	CPUs.
>  
> +--show-kernel-path::
> +	Try to resolve the path of [kernel.kallsyms]
> +
>  SEE ALSO
>  --------
>  linkperf:perf-record[1], linkperf:perf-script-perl[1],
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index fd68185..0d04788 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -1099,6 +1099,8 @@ static const struct option options[] = {
>  		     "addr,offs",
>  		     parse_output_fields),
>  	OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
> +	OPT_BOOLEAN('\0', "show-kernel-path", &show_kernel_path,
> +		    "Show the path of [kernel.kallsyms]"),
>  
>  	OPT_END()
>  };
> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
> index dddc0f3..1645967 100644
> --- a/tools/perf/util/map.c
> +++ b/tools/perf/util/map.c
> @@ -204,9 +204,12 @@ void map__print_dsoname(struct map *self)
>  {
>  	const char *dsoname;
>  
> -	if (self && self->dso && self->dso->name)
> +	if (self && self->dso && (self->dso->name || self->dso->long_name)) {
> +		if (show_kernel_path && self->dso->long_name)
> +			dsoname = self->dso->long_name;
> +		else if (self->dso->name)
>  			dsoname = self->dso->name;
> -	else
> +	} else
>  		dsoname = "[unknown]";
>  
>  	printf("%s", dsoname);
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index 3728e67..34c5887 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -14,6 +14,8 @@
>  #include "util.h"
>  #include "cpumap.h"
>  
> +bool show_kernel_path;
> +
>  static int perf_session__open(struct perf_session *self, bool force)
>  {
>  	struct stat input_stat;
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index abfecf6..3356d6e 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -41,6 +41,7 @@ static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map,
>  			symbol_filter_t filter);
>  static int vmlinux_path__nr_entries;
>  static char **vmlinux_path;
> +bool show_kernel_path;

declared twice. See above in session.c. I suggest removing the one in
session.c

David


>  
>  struct symbol_conf symbol_conf = {
>  	.exclude_other	  = true,
> diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
> index 554b2fe..88000e5 100644
> --- a/tools/perf/util/symbol.h
> +++ b/tools/perf/util/symbol.h
> @@ -96,6 +96,7 @@ struct symbol_conf {
>  };
>  
>  extern struct symbol_conf symbol_conf;
> +extern bool show_kernel_path;
>  
>  static inline void *symbol__priv(struct symbol *sym)
>  {
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 1/6] [BUGFIX] perf script: print correct IP address
  2011-07-17 15:59   ` David Ahern
@ 2011-07-17 17:29     ` Frederic Weisbecker
  0 siblings, 0 replies; 22+ messages in thread
From: Frederic Weisbecker @ 2011-07-17 17:29 UTC (permalink / raw)
  To: David Ahern
  Cc: Akihiro Nagai, Arnaldo Carvalho de Melo, Ingo Molnar,
	Peter Zijlstra, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

On Sun, Jul 17, 2011 at 09:59:26AM -0600, David Ahern wrote:
> On 07/17/2011 03:30 AM, Akihiro Nagai wrote:
> > perf_session_print_ip() prints addr_location->addr as IP address.
> > It's not always same as IP address. To correct it, this function
> > must print sample->ip.
> > 
> > Changes in v2:
> >  - add this patch
> 
> I submitted a patch for this back in May that was not picked up:
> https://lkml.org/lkml/2011/5/30/223
> 
> David

Oops, I'm going to bounce it to Peter / Ingo / Arnaldo...

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols
  2011-07-17 16:30     ` David Ahern
@ 2011-07-21  9:36       ` Akihiro Nagai
  2011-07-21  9:42         ` Peter Zijlstra
  2011-07-21 14:39         ` David Ahern
  0 siblings, 2 replies; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-21  9:36 UTC (permalink / raw)
  To: David Ahern
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

(2011/07/18 1:30), David Ahern wrote:
> On 07/17/2011 10:07 AM, David Ahern wrote:
>>
>>
>> On 07/17/2011 03:30 AM, Akihiro Nagai wrote:
>>> Latest perf-script doesn't output symbol name when it failed to
>>> resolve symbol name. This output is not friendly for external scripts
>>> because it causes misaligment. So, this patch adds the magic word
>>> "(unknown)" when perf-script failed to resolve symbols.
>>
>> Code has [unknown] with {}, not ().
>
> Evidently I had the shift key down -- s/{}/[]/.  :-) And I see now, for
> dsoname you have [unknown] and for symname (unknown). Use the same for
> both. Since () is already used for separating dsoname, use [unknown] for
> both
At print_sample_start() in builtin-script.c, there is the code that print "(unknown)"
when perf cannnot resolve the event name.

     printf("%s: ", evname ? evname : "(unknown)");

On the other hand, at hist_entry__dso_snprintf() in util/sort.c, there is the code
prints "[unknown]" for unresolvable DSO name.

     return repsep_snprintf(bf, size, "%-*s", width, "[unknown]");

In addition, perf uses "[]" for DSO name for example "[kernel.kallsyms]".
So, I chose it. However, this specification is not easy for user-scripts.
Should I unify this expression?

Thank you.
>
> David
>
>
>>
>>>
>>> At the same time, this patch changes perf-script to output "[unknown]"
>>> in the DSO field, when it failed to resolve the path of DSOs.
>>>
>>> Changes in v2:
>>>   - add this patch
>>>
>>> Signed-off-by: Akihiro Nagai<akihiro.nagai.hw@hitachi.com>
>>> Cc: Peter Zijlstra<peterz@infradead.org>
>>> Cc: Frederic Weisbecker<fweisbec@gmail.com>
>>> Cc: Paul Mackerras<paulus@samba.org>
>>> Cc: Ingo Molnar<mingo@elte.hu>
>>> Cc: Arnaldo Carvalho de Melo<acme@infradead.org>
>>> Cc: David Ahern<dsahern@gmail.com>
>>> Cc: Masami Hiramatsu<masami.hiramatsu.pt@hitachi.com>
>>> ---
>>>
>>>   tools/perf/builtin-script.c |   18 +++++-------------
>>>   tools/perf/util/map.c       |   12 ++++++++++++
>>>   tools/perf/util/map.h       |    1 +
>>>   tools/perf/util/session.c   |   35 ++++++++++-------------------------
>>>   tools/perf/util/symbol.c    |   12 ++++++++++++
>>>   tools/perf/util/symbol.h    |    1 +
>>>   6 files changed, 41 insertions(+), 38 deletions(-)
>>>
>>> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
>>> index 09024ec..b3e0951 100644
>>> --- a/tools/perf/builtin-script.c
>>> +++ b/tools/perf/builtin-script.c
>>> @@ -320,7 +320,6 @@ static void print_sample_addr(union perf_event *event,
>>>   {
>>>   	struct addr_location al;
>>>   	u8 cpumode = event->header.misc&  PERF_RECORD_MISC_CPUMODE_MASK;
>>> -	const char *symname, *dsoname;
>>>
>>>   	printf("%16" PRIx64, sample->addr);
>>>
>>> @@ -340,21 +339,14 @@ static void print_sample_addr(union perf_event *event,
>>>   		al.sym = map__find_symbol(al.map, al.addr, NULL);
>>>
>>>   	if (PRINT_FIELD(SYM)) {
>>> -		if (al.sym&&  al.sym->name)
>>> -			symname = al.sym->name;
>>> -		else
>>> -			symname = "";
>>> -
>>> -		printf(" %16s", symname);
>>> +		printf(" ");
>>> +		symbol__print_symname(al.sym);
>>>   	}
>>>
>>>   	if (PRINT_FIELD(DSO)) {
>>> -		if (al.map&&  al.map->dso&&  al.map->dso->name)
>>> -			dsoname = al.map->dso->name;
>>> -		else
>>> -			dsoname = "";
>>> -
>>> -		printf(" (%s)", dsoname);
>>> +		printf(" (");
>>> +		map__print_dsoname(al.map);
>>> +		printf(")");
>>>   	}
>>>   }
>>>
>>> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
>>> index a16ecab..dddc0f3 100644
>>> --- a/tools/perf/util/map.c
>>> +++ b/tools/perf/util/map.c
>>> @@ -200,6 +200,18 @@ size_t map__fprintf(struct map *self, FILE *fp)
>>>   		       self->start, self->end, self->pgoff, self->dso->name);
>>>   }
>>>
>>> +void map__print_dsoname(struct map *self)
>>> +{
>>> +	const char *dsoname;
>>> +
>>> +	if (self&&  self->dso&&  self->dso->name)
>>> +			dsoname = self->dso->name;
>>
>> extra tab in the above line.
>>
>> Otherwise looks good to me.
Oops! I fix it. Thank you.
>>
>> Acked-By: dsahern@gmail.com
>>
>>> +	else
>>> +		dsoname = "[unknown]";
>>> +
>>> +	printf("%s", dsoname);
>>> +}
>>> +
>>>   /*
>>>    * objdump wants/reports absolute IPs for ET_EXEC, and RIPs for ET_DYN.
>>>    * map->dso->adjust_symbols==1 for ET_EXEC-like cases.
>>> diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
>>> index b397c03..6f452b9 100644
>>> --- a/tools/perf/util/map.h
>>> +++ b/tools/perf/util/map.h
>>> @@ -112,6 +112,7 @@ void map__delete(struct map *self);
>>>   struct map *map__clone(struct map *self);
>>>   int map__overlap(struct map *l, struct map *r);
>>>   size_t map__fprintf(struct map *self, FILE *fp);
>>> +void map__print_dsoname(struct map *self);
>>>
>>>   int map__load(struct map *self, symbol_filter_t filter);
>>>   struct symbol *map__find_symbol(struct map *self,
>>> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
>>> index 453a010..442be3a 100644
>>> --- a/tools/perf/util/session.c
>>> +++ b/tools/perf/util/session.c
>>> @@ -1214,7 +1214,6 @@ void perf_session__print_ip(union perf_event *event,
>>>   			    int print_sym, int print_dso)
>>>   {
>>>   	struct addr_location al;
>>> -	const char *symname, *dsoname;
>>>   	struct callchain_cursor *cursor =&session->callchain_cursor;
>>>   	struct callchain_cursor_node *node;
>>>
>>> @@ -1242,20 +1241,13 @@ void perf_session__print_ip(union perf_event *event,
>>>
>>>   			printf("\t%16" PRIx64, node->ip);
>>>   			if (print_sym) {
>>> -				if (node->sym&&  node->sym->name)
>>> -					symname = node->sym->name;
>>> -				else
>>> -					symname = "";
>>> -
>>> -				printf(" %s", symname);
>>> +				printf(" ");
>>> +				symbol__print_symname(node->sym);
>>>   			}
>>>   			if (print_dso) {
>>> -				if (node->map&&  node->map->dso&&  node->map->dso->name)
>>> -					dsoname = node->map->dso->name;
>>> -				else
>>> -					dsoname = "";
>>> -
>>> -				printf(" (%s)", dsoname);
>>> +				printf(" (");
>>> +				map__print_dsoname(al.map);
>>> +				printf(")");
>>>   			}
>>>   			printf("\n");
>>>
>>> @@ -1265,21 +1257,14 @@ void perf_session__print_ip(union perf_event *event,
>>>   	} else {
>>>   		printf("%16" PRIx64, sample->ip);
>>>   		if (print_sym) {
>>> -			if (al.sym&&  al.sym->name)
>>> -				symname = al.sym->name;
>>> -			else
>>> -				symname = "";
>>> -
>>> -			printf(" %s", symname);
>>> +			printf(" ");
>>> +			symbol__print_symname(al.sym);
>>>   		}
>>>
>>>   		if (print_dso) {
>>> -			if (al.map&&  al.map->dso&&  al.map->dso->name)
>>> -				dsoname = al.map->dso->name;
>>> -			else
>>> -				dsoname = "";
>>> -
>>> -			printf(" (%s)", dsoname);
>>> +			printf(" (");
>>> +			map__print_dsoname(al.map);
>>> +			printf(")");
>>>   		}
>>>   	}
>>>   }
>>> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
>>> index eec1963..85e19c4 100644
>>> --- a/tools/perf/util/symbol.c
>>> +++ b/tools/perf/util/symbol.c
>>> @@ -175,6 +175,18 @@ static size_t symbol__fprintf(struct symbol *sym, FILE *fp)
>>>   		       sym->name);
>>>   }
>>>
>>> +void symbol__print_symname(const struct symbol *sym)
>>> +{
>>> +	const char *symname;
>>> +
>>> +	if (sym&&  sym->name)
>>> +		symname = sym->name;
>>> +	else
>>> +		symname = "(unknown)";
>>> +
>>> +	printf("%s", symname);
>>> +}
>>> +
>>>   void dso__set_long_name(struct dso *dso, char *name)
>>>   {
>>>   	if (name == NULL)
>>> diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
>>> index 325ee36..1ec17b4 100644
>>> --- a/tools/perf/util/symbol.h
>>> +++ b/tools/perf/util/symbol.h
>>> @@ -238,6 +238,7 @@ void machines__destroy_guest_kernel_maps(struct rb_root *machines);
>>>
>>>   int symbol__init(void);
>>>   void symbol__exit(void);
>>> +void symbol__print_symname(const struct symbol *sym);
>>>   bool symbol_type__is_a(char symbol_type, enum map_type map_type);
>>>
>>>   size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
>>>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 3/6] perf script: resolve DSOs and symbols for user-space
  2011-07-17 16:20   ` David Ahern
@ 2011-07-21  9:36     ` Akihiro Nagai
  0 siblings, 0 replies; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-21  9:36 UTC (permalink / raw)
  To: David Ahern
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

(2011/07/18 1:20), David Ahern wrote:
> On 07/17/2011 03:30 AM, Akihiro Nagai wrote:
>> Resolve user-space DSOs and symbols.
>> Latest perf-script can resolve DSOs and symbols for only kernel
>> and kernel modules. This patch resolves them for other
>> executable binaries.
>
> The description is a bit misleading. perf script does resolve symbols
> for userspace. e.g., the example in the bug fix I submitted in May:
> https://lkml.org/lkml/2011/5/30/223
>
> Do you look into why the cpumode setting is not working that you have to
> try specific settings?
Indeed, perf already can resolve user-space symbols and DSOs if cpumode has
the flag PERF_RECORD_MISC_USER. I found this change is incorrect.
To solve this, I'd like to set both flags PERF_RECORD_MISC_KERNEL and USER
to BTS records, because BTS traces both kernel and user space while it
generates interrupts.

And also, I think there is the probrem in thread__find_addr_map().
When this function is called with cpumode that is set (PERF_RECORD_MISC_KERNEL | USER),
this function processes only PERF_RECORD_MISC_KERNEL. So, I'd like to fix it too.

Thank you.
>
> David
>
>
>>
>> # perf script -f ip,addr,sym,dso
>> 3f03e016b0 ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e016b0 ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e04b80       3f03e016b3 _start (/lib64/ld-2.14.so)
>> 3f03e04b80 ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e04ba6 ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e04bad ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e04c1d       3f03e04bfb _dl_start (/lib64/ld-2.14.so)
>> 3f03e04c00       3f03e04c21 _dl_start (/lib64/ld-2.14.so)
>> 3f03e04c00       3f03e04c21 _dl_start (/lib64/ld-2.14.so)
>> [snip]
>>
>> Signed-off-by: Akihiro Nagai<akihiro.nagai.hw@hitachi.com>
>> Cc: Peter Zijlstra<peterz@infradead.org>
>> Cc: Frederic Weisbecker<fweisbec@gmail.com>
>> Cc: Paul Mackerras<paulus@samba.org>
>> Cc: Ingo Molnar<mingo@elte.hu>
>> Cc: Arnaldo Carvalho de Melo<acme@infradead.org>
>> Cc: David Ahern<dsahern@gmail.com>
>> Cc: Masami Hiramatsu<masami.hiramatsu.pt@hitachi.com>
>> ---
>>
>>   tools/perf/builtin-script.c |    4 ++++
>>   tools/perf/util/event.c     |    5 +++++
>>   2 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
>> index b3e0951..2356198 100644
>> --- a/tools/perf/builtin-script.c
>> +++ b/tools/perf/builtin-script.c
>> @@ -328,6 +328,10 @@ static void print_sample_addr(union perf_event *event,
>>
>>   	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
>>   			      event->ip.pid, sample->addr,&al);
>> +	/* try to resolve for user space */
>> +	if (!al.map)
>> +		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
>> +			MAP__FUNCTION, event->ip.pid, sample->addr,&al);
>>   	if (!al.map)
>>   		thread__find_addr_map(thread, session, cpumode, MAP__VARIABLE,
>>   				      event->ip.pid, sample->addr,&al);
>> diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
>> index 3c1b8a6..49a9315 100644
>> --- a/tools/perf/util/event.c
>> +++ b/tools/perf/util/event.c
>> @@ -771,6 +771,11 @@ int perf_event__preprocess_sample(const union perf_event *event,
>>
>>   	thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
>>   			      event->ip.pid, event->ip.ip, al);
>> +	/* try to resolve for user space */
>> +	if (!al->map)
>> +		thread__find_addr_map(thread, session, PERF_RECORD_MISC_USER,
>> +				MAP__FUNCTION, event->ip.pid, event->ip.ip, al);
>> +
>>   	dump_printf(" ...... dso: %s\n",
>>   		    al->map ? al->map->dso->long_name :
>>   			al->level == 'H' ? "[hypervisor]" : "<not found>");
>>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 4/6] perf script: print DSOs and symbols for BTS branch_from addr
  2011-07-17 16:22   ` David Ahern
@ 2011-07-21  9:36     ` Akihiro Nagai
  0 siblings, 0 replies; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-21  9:36 UTC (permalink / raw)
  To: David Ahern
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

(2011/07/18 1:22), David Ahern wrote:
>
>
> On 07/17/2011 03:31 AM, Akihiro Nagai wrote:
>> Print DSOs and symbols for branch_from address of BTS.
>> BTS records branch_from address in 'addr' fields,
>> and branch_to address in 'ip' field. Latest perf-script
>> resolves DSOs and symbols only for 'ip' field.
>> This patch resolves them for 'addr' field too.
>
> Description does not match code change. What you are doing is enhancing
> the detection of when a sample address should correlate to a symbol. In
> this case you are adding HW_BRANCH_INSTRUCTIONS event.
I see. In the next patch set, I'd like to fix it. For example,
"Enhance IP and ADDR correlation detection of BTS event"

Thank you.

>
> David
>
>
>>
>> # perf script -f ip,addr,dso,sym
>> 3f03e016b0 (unknown) ([kernel.kallsyms]) ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e016b0    _start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e04b80 _dl_start (/lib64/ld-2.14.so)       3f03e016b3 _start (/lib64/ld-2.14.so)
>> 3f03e04b80 _dl_start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e04ba6 _dl_start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e04bad _dl_start (/lib64/ld-2.14.so) ffffffff814675d2 irq_return ([kernel.kallsyms])
>> 3f03e04c1d _dl_start (/lib64/ld-2.14.so)       3f03e04bfb _dl_start (/lib64/ld-2.14.so)
>> [snip]
>>
>> Signed-off-by: Akihiro Nagai<akihiro.nagai.hw@hitachi.com>
>> Cc: Peter Zijlstra<peterz@infradead.org>
>> Cc: Frederic Weisbecker<fweisbec@gmail.com>
>> Cc: Paul Mackerras<paulus@samba.org>
>> Cc: Ingo Molnar<mingo@elte.hu>
>> Cc: Arnaldo Carvalho de Melo<acme@infradead.org>
>> Cc: David Ahern<dsahern@gmail.com>
>> Cc: Masami Hiramatsu<masami.hiramatsu.pt@hitachi.com>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 6/6] perf script: add option resolving vmlinux path
  2011-07-17 16:36   ` David Ahern
@ 2011-07-21  9:36     ` Akihiro Nagai
  0 siblings, 0 replies; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-21  9:36 UTC (permalink / raw)
  To: David Ahern
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

(2011/07/18 1:36), David Ahern wrote:
> On 07/17/2011 03:31 AM, Akihiro Nagai wrote:
>> Add the option get the path of [kernel.kallsyms].
>> Specify '--show-kernel-path' option to use this function.
>> This patch enables other applications to use this output easily.
>>
>> Without --show-kernel-path  option
>>
>> # perf script -f ip,dso
>> ffffffff81467612 irq_return ([kernel.kallsyms])
>> ffffffff81467612 irq_return ([kernel.kallsyms])
>>      7f24fc02a6b3 _start (/lib64/ld-2.14.so)
>> [snip]
>>
>> With --show-kernel-path option
>>
>> # perf script -f ip,dso --show-kernel-path
>> ffffffff81467612 irq_return (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
>> ffffffff81467612 irq_return (/lib/modules/3.0.0-rc6-tip+/build/vmlinux)
>>      7f24fc02a6b3 _start (/lib64/ld-2.14.so)
>> [snip]
>>
>> Signed-off-by: Akihiro Nagai<akihiro.nagai.hw@hitachi.com>
>> Cc: Peter Zijlstra<peterz@infradead.org>
>> Cc: Frederic Weisbecker<fweisbec@gmail.com>
>> Cc: Paul Mackerras<paulus@samba.org>
>> Cc: Ingo Molnar<mingo@elte.hu>
>> Cc: Arnaldo Carvalho de Melo<acme@infradead.org>
>> Cc: David Ahern<dsahern@gmail.com>
>> Cc: Masami Hiramatsu<masami.hiramatsu.pt@hitachi.com>
>> ---
>>
>>   tools/perf/Documentation/perf-script.txt |    3 +++
>>   tools/perf/builtin-script.c              |    2 ++
>>   tools/perf/util/map.c                    |    7 +++++--
>>   tools/perf/util/session.c                |    2 ++
>>   tools/perf/util/symbol.c                 |    1 +
>>   tools/perf/util/symbol.h                 |    1 +
>>   6 files changed, 14 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
>> index ee4d477..5383671 100644
>> --- a/tools/perf/Documentation/perf-script.txt
>> +++ b/tools/perf/Documentation/perf-script.txt
>> @@ -188,6 +188,9 @@ OPTIONS
>>   	CPUs are specified with -: 0-2. Default is to report samples on all
>>   	CPUs.
>>
>> +--show-kernel-path::
>> +	Try to resolve the path of [kernel.kallsyms]
>> +
>>   SEE ALSO
>>   --------
>>   linkperf:perf-record[1], linkperf:perf-script-perl[1],
>> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
>> index fd68185..0d04788 100644
>> --- a/tools/perf/builtin-script.c
>> +++ b/tools/perf/builtin-script.c
>> @@ -1099,6 +1099,8 @@ static const struct option options[] = {
>>   		     "addr,offs",
>>   		     parse_output_fields),
>>   	OPT_STRING('c', "cpu",&cpu_list, "cpu", "list of cpus to profile"),
>> +	OPT_BOOLEAN('\0', "show-kernel-path",&show_kernel_path,
>> +		    "Show the path of [kernel.kallsyms]"),
>>
>>   	OPT_END()
>>   };
>> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
>> index dddc0f3..1645967 100644
>> --- a/tools/perf/util/map.c
>> +++ b/tools/perf/util/map.c
>> @@ -204,9 +204,12 @@ void map__print_dsoname(struct map *self)
>>   {
>>   	const char *dsoname;
>>
>> -	if (self&&  self->dso&&  self->dso->name)
>> +	if (self&&  self->dso&&  (self->dso->name || self->dso->long_name)) {
>> +		if (show_kernel_path&&  self->dso->long_name)
>> +			dsoname = self->dso->long_name;
>> +		else if (self->dso->name)
>>   			dsoname = self->dso->name;
>> -	else
>> +	} else
>>   		dsoname = "[unknown]";
>>
>>   	printf("%s", dsoname);
>> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
>> index 3728e67..34c5887 100644
>> --- a/tools/perf/util/session.c
>> +++ b/tools/perf/util/session.c
>> @@ -14,6 +14,8 @@
>>   #include "util.h"
>>   #include "cpumap.h"
>>
>> +bool show_kernel_path;
>> +
>>   static int perf_session__open(struct perf_session *self, bool force)
>>   {
>>   	struct stat input_stat;
>> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
>> index abfecf6..3356d6e 100644
>> --- a/tools/perf/util/symbol.c
>> +++ b/tools/perf/util/symbol.c
>> @@ -41,6 +41,7 @@ static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map,
>>   			symbol_filter_t filter);
>>   static int vmlinux_path__nr_entries;
>>   static char **vmlinux_path;
>> +bool show_kernel_path;
>
> declared twice. See above in session.c. I suggest removing the one in
> session.c
Oops. I forgot to delete it.
Thank you.
>
> David
>
>
>>
>>   struct symbol_conf symbol_conf = {
>>   	.exclude_other	  = true,
>> diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
>> index 554b2fe..88000e5 100644
>> --- a/tools/perf/util/symbol.h
>> +++ b/tools/perf/util/symbol.h
>> @@ -96,6 +96,7 @@ struct symbol_conf {
>>   };
>>
>>   extern struct symbol_conf symbol_conf;
>> +extern bool show_kernel_path;
>>
>>   static inline void *symbol__priv(struct symbol *sym)
>>   {
>>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols
  2011-07-21  9:36       ` Akihiro Nagai
@ 2011-07-21  9:42         ` Peter Zijlstra
  2011-07-21 14:39         ` David Ahern
  1 sibling, 0 replies; 22+ messages in thread
From: Peter Zijlstra @ 2011-07-21  9:42 UTC (permalink / raw)
  To: Akihiro Nagai
  Cc: David Ahern, Arnaldo Carvalho de Melo, Ingo Molnar,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

On Thu, 2011-07-21 at 18:36 +0900, Akihiro Nagai wrote:
> In addition, perf uses "[]" for DSO name for example
> "[kernel.kallsyms]".

We only use that for kernel dsos iirc.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols
  2011-07-21  9:36       ` Akihiro Nagai
  2011-07-21  9:42         ` Peter Zijlstra
@ 2011-07-21 14:39         ` David Ahern
  2011-07-22  4:25           ` Akihiro Nagai
  1 sibling, 1 reply; 22+ messages in thread
From: David Ahern @ 2011-07-21 14:39 UTC (permalink / raw)
  To: Akihiro Nagai
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

On 07/21/2011 03:36 AM, Akihiro Nagai wrote
>> Evidently I had the shift key down -- s/{}/[]/.  :-) And I see now, for
>> dsoname you have [unknown] and for symname (unknown). Use the same for
>> both. Since () is already used for separating dsoname, use [unknown] for
>> both
> At print_sample_start() in builtin-script.c, there is the code that
> print "(unknown)"
> when perf cannnot resolve the event name.
> 
>     printf("%s: ", evname ? evname : "(unknown)");
> 
> On the other hand, at hist_entry__dso_snprintf() in util/sort.c, there
> is the code
> prints "[unknown]" for unresolvable DSO name.
> 
>     return repsep_snprintf(bf, size, "%-*s", width, "[unknown]");
> 
> In addition, perf uses "[]" for DSO name for example "[kernel.kallsyms]".
> So, I chose it. However, this specification is not easy for user-scripts.
> Should I unify this expression?

That was my thought -- to use the same for both dso and sym if it is
unknown. And since DSO names are wrapped in () use "[unknown]" for both
-- ie., right now the format is  "symname (dsoname)" (though kernel syms
from kallsyms come out as "symname ([kernel.kallsyms])"). With an
unknown it will be "[unknown] (dsoname)" or "[unknown] ([unknown])"
which retains the number of fields in a uniquely parse-able way.

David

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols
  2011-07-21 14:39         ` David Ahern
@ 2011-07-22  4:25           ` Akihiro Nagai
  0 siblings, 0 replies; 22+ messages in thread
From: Akihiro Nagai @ 2011-07-22  4:25 UTC (permalink / raw)
  To: David Ahern
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Peter Zijlstra,
	Frederic Weisbecker, linux-kernel, Masami Hiramatsu,
	yrl.pp-manager.tt, Paul Mackerras

(2011/07/21 23:39), David Ahern wrote:
> On 07/21/2011 03:36 AM, Akihiro Nagai wrote
>>> Evidently I had the shift key down -- s/{}/[]/.  :-) And I see now, for
>>> dsoname you have [unknown] and for symname (unknown). Use the same for
>>> both. Since () is already used for separating dsoname, use [unknown] for
>>> both
>> At print_sample_start() in builtin-script.c, there is the code that
>> print "(unknown)"
>> when perf cannnot resolve the event name.
>>
>>      printf("%s: ", evname ? evname : "(unknown)");
>>
>> On the other hand, at hist_entry__dso_snprintf() in util/sort.c, there
>> is the code
>> prints "[unknown]" for unresolvable DSO name.
>>
>>      return repsep_snprintf(bf, size, "%-*s", width, "[unknown]");
>>
>> In addition, perf uses "[]" for DSO name for example "[kernel.kallsyms]".
>> So, I chose it. However, this specification is not easy for user-scripts.
>> Should I unify this expression?
>
> That was my thought -- to use the same for both dso and sym if it is
> unknown. And since DSO names are wrapped in () use "[unknown]" for both
> -- ie., right now the format is  "symname (dsoname)" (though kernel syms
> from kallsyms come out as "symname ([kernel.kallsyms])"). With an
> unknown it will be "[unknown] (dsoname)" or "[unknown] ([unknown])"
> which retains the number of fields in a uniquely parse-able way.
I agree.
In the next patch set, I'd like to unify the all expressions to "[unknown]".

Thank you.
>
> David

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2011-07-22  4:25 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-17  9:30 [PATCH -tip v2 0/6] perf script: add BTS analysis features Akihiro Nagai
2011-07-17  9:30 ` [PATCH -tip v2 1/6] [BUGFIX] perf script: print correct IP address Akihiro Nagai
2011-07-17 15:59   ` David Ahern
2011-07-17 17:29     ` Frederic Weisbecker
2011-07-17  9:30 ` [PATCH -tip v2 2/6] perf script: add magic word to indicate the failure of resolving symbols Akihiro Nagai
2011-07-17 16:07   ` David Ahern
2011-07-17 16:30     ` David Ahern
2011-07-21  9:36       ` Akihiro Nagai
2011-07-21  9:42         ` Peter Zijlstra
2011-07-21 14:39         ` David Ahern
2011-07-22  4:25           ` Akihiro Nagai
2011-07-17  9:30 ` [PATCH -tip v2 3/6] perf script: resolve DSOs and symbols for user-space Akihiro Nagai
2011-07-17 16:20   ` David Ahern
2011-07-21  9:36     ` Akihiro Nagai
2011-07-17  9:31 ` [PATCH -tip v2 4/6] perf script: print DSOs and symbols for BTS branch_from addr Akihiro Nagai
2011-07-17 16:22   ` David Ahern
2011-07-21  9:36     ` Akihiro Nagai
2011-07-17  9:31 ` [PATCH -tip v2 5/6] perf script: add the offset field specifier Akihiro Nagai
2011-07-17 16:28   ` David Ahern
2011-07-17  9:31 ` [PATCH -tip v2 6/6] perf script: add option resolving vmlinux path Akihiro Nagai
2011-07-17 16:36   ` David Ahern
2011-07-21  9:36     ` Akihiro Nagai

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.