[PATCH] perf script: fix regression in dso name

From: David Ahern
Date: Wed May 30 2012 - 00:59:08 EST


$ perf script -i /tmp/perf.data
...
gcc 13623 544315.062858: context-switches:
ffffffff815f65c9 __schedule ([kernel.kallsyms])
ffffffff81087cea __cond_resched ([kernel.kallsyms])
ffffffff815f6b92 _cond_resched ([kernel.kallsyms])
ffffffff815fb87a do_page_fault ([kernel.kallsyms])
ffffffff815f8465 page_fault ([kernel.kallsyms])
2b7a71ea0303 _dl_lookup_symbol_x ([kernel.kallsyms])
2b7a71ea1eb5 _dl_relocate_object ([kernel.kallsyms])
2b7a71e99b2e dl_main ([kernel.kallsyms])
2b7a71eab7f4 _dl_sysdep_start ([kernel.kallsyms])

All DSO's in a callchain are printed as [kernel.kallsyms].

git bisect chased it to:

547a92e0aedb88129e7fbd804697a11949de2e5a is the first bad commit
commit 547a92e0aedb88129e7fbd804697a11949de2e5a
Author: Akihiro Nagai <akihiro.nagai.hw@xxxxxxxxxxx>
Date: Mon Jan 30 13:42:57 2012 +0900

perf script: Unify the expressions indicating "unknown"

The perf script command uses various expressions to indicate "unknown".

It is unfriendly for user scripts to parse it. So, this patch unifies
the expressions to "[unknown]".

Looks like a copy-paste in that the other references use al.map but this one
should be node->map.

With this patch you get:

$ perf script -i /tmp/perf.data
...
gcc 13623 544315.062858: context-switches:
ffffffff815f65c9 __schedule ([kernel.kallsyms])
ffffffff81087cea __cond_resched ([kernel.kallsyms])
ffffffff815f6b92 _cond_resched ([kernel.kallsyms])
ffffffff815fb87a do_page_fault ([kernel.kallsyms])
ffffffff815f8465 page_fault ([kernel.kallsyms])
2b7a71ea0303 _dl_lookup_symbol_x (/lib64/ld-2.14.90.so)
2b7a71ea1eb5 _dl_relocate_object (/lib64/ld-2.14.90.so)
2b7a71e99b2e dl_main (/lib64/ld-2.14.90.so)
2b7a71eab7f4 _dl_sysdep_start (/lib64/ld-2.14.90.so)

CC: Akihiro Nagai <akihiro.nagai.hw@xxxxxxxxxxx>

Signed-off-by: David Ahern <dsahern@xxxxxxxxx>
---
tools/perf/util/session.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 93d355d..4820614 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1460,7 +1460,7 @@ void perf_event__print_ip(union perf_event *event, struct perf_sample *sample,
}
if (print_dso) {
printf(" (");
- map__fprintf_dsoname(al.map, stdout);
+ map__fprintf_dsoname(node->map, stdout);
printf(")");
}
printf("\n");
--
1.7.10.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/