commit 99972c0ef5d70778a54d83c6641e95403479612c
parent e7441fdf68f9f69a1e5be6d986759a4fb6ea596c
Author: Brendan Gregg <brendan.d.gregg@gmail.com>
Date: Sun, 30 Jul 2017 15:24:16 -0700
improve kernel annotation detection
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/stackcollapse-perf.pl b/stackcollapse-perf.pl
@@ -299,11 +299,12 @@ while (defined($_ = <>)) {
# detect kernel from the module name; eg, frames to parse include:
# ffffffff8103ce3b native_safe_halt ([kernel.kallsyms])
# 8c3453 tcp_sendmsg (/lib/modules/4.3.0-rc1-virtual/build/vmlinux)
+ # 7d8 ipv4_conntrack_local+0x7f8f80b8 ([nf_conntrack_ipv4])
# detect jit from the module name; eg:
# 7f722d142778 Ljava/io/PrintStream;::print (/tmp/perf-19982.map)
if (scalar(@inline) > 0) {
$func .= "_[i]"; # inlined
- } elsif ($annotate_kernel == 1 && $mod =~ m/(kernel\.|vmlinux$)/) {
+ } elsif ($annotate_kernel == 1 && $mod =~ m/(^\[|vmlinux$)/ && $mod !~ /unknown/) {
$func .= "_[k]"; # kernel
} elsif ($annotate_jit == 1 && $mod =~ m:/tmp/perf-\d+\.map:) {
$func .= "_[j]"; # jitted
diff --git a/test/results/perf-iperf-stacks-pidtid-01.txt-collapsed-kernel.txt b/test/results/perf-iperf-stacks-pidtid-01.txt-collapsed-kernel.txt
@@ -1,5 +1,5 @@
iperf;[unknown];[iperf] 1
-iperf;[unknown];[iperf];__vdso_gettimeofday 1
+iperf;[unknown];[iperf];__vdso_gettimeofday_[k] 1
iperf;[unknown];[libpthread-2.19.so];entry_SYSCALL_64_fastpath_[k];__fdget_pos_[k] 1
iperf;[unknown];[libpthread-2.19.so];entry_SYSCALL_64_fastpath_[k];sys_write_[k];vfs_write_[k];__vfs_write_[k];sock_write_iter_[k];sock_sendmsg_[k];inet_sendmsg_[k];copy_from_iter_[k] 1
iperf;[unknown];[libpthread-2.19.so];entry_SYSCALL_64_fastpath_[k];sys_write_[k];vfs_write_[k];__vfs_write_[k];sock_write_iter_[k];sock_sendmsg_[k];inet_sendmsg_[k];release_sock_[k] 1