Skip to content

Commit

Permalink
fix offsets again with kernel annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
brendangregg committed Dec 16, 2016
1 parent 8e9d1b2 commit ef64564
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions stackcollapse-perf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ sub inline {
} elsif (/^\s*(\w+)\s*(.+) \((\S*)\)/) {
my ($pc, $rawfunc, $mod) = ($1, $2, $3);

# Linux 4.8 included symbol offsets in perf script output by default, eg:
# 7fffb84c9afc cpu_startup_entry+0x800047c022ec ([kernel.kallsyms])
# strip these off:
$rawfunc =~ s/\+0x[\da-f]+$//;

# 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)
Expand All @@ -222,11 +227,6 @@ sub inline {
for (split /\->/, $rawfunc) {
my $func = $_;

# Linux 4.8 included symbol offsets in perf script output by default, eg:
# 7fffb84c9afc cpu_startup_entry+0x800047c022ec ([kernel.kallsyms])
# strip these off:
$func =~ s/\+0x[\da-f]+$//;

if ($func eq "[unknown]" && $mod ne "[unknown]") { # use module name instead, if known
$func = $mod;
$func =~ s/.*\///;
Expand Down
6 changes: 3 additions & 3 deletions test/results/perf-rust-Yamakaky-dcpu.txt-collapsed-kernel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ emulator;__rust_maybe_catch_panic;emulator::main::hc2aaa9b4591a10c7;emulator::ma
emulator;__rust_maybe_catch_panic;emulator::main::hc2aaa9b4591a10c7;emulator::main_ret::hc4b7fa9090639ebe;simplelog::termlog::TermLogger::init::ha7463b1622ff979e;log::set_logger::hfce3bfc5d262a203;log::set_logger_raw::h2040ab7e0793ea3f;log::set_logger::_$u7b$$u7b$closure$u7d$$u7d$::hcb7821323b596727;simplelog::termlog::TermLogger::init::_$u7b$$u7b$closure$u7d$$u7d$::h347f6695ed91405f;simplelog::termlog::TermLogger::new::h94d15a7bc0cbc21f;term::stdout::hc71a921b9549a869;_$LT$term..terminfo..TerminfoTerminal$LT$T$GT$$GT$::new::h52a3a52cf0fd4041;term::terminfo::TermInfo::from_env::h7aa5bbfa652bcb0d;term::terminfo::TermInfo::from_name::h721edfed0d4e6840;_$LT$core..result..Result$LT$T$C$$u20$E$GT$$GT$::and_then::h47fa4b8545196b9b;term::terminfo::TermInfo::from_name::_$u7b$$u7b$closure$u7d$$u7d$::hbdb8aa57609652e0;term::terminfo::TermInfo::from_path::hc007f27f9c5301db;term::terminfo::TermInfo::_from_path::h51064971a80093cd;term::terminfo::parser::compiled::parse::h0bfa24a8d6483291;core::iter::iterator::Iterator::collect::h53b7863e73fadbfc;_$LT$core..result..Result$LT$V$C$$u20$E$GT$$u20$as$u20$core..iter..traits..FromIterator$LT$core..result..Result$LT$A$C$$u20$E$GT$$GT$$GT$::from_iter::h7ad818accf02e73a;_$LT$collections..vec..Vec$LT$T$GT$$u20$as$u20$core..iter..traits..FromIterator$LT$T$GT$$GT$::from_iter::h461e3a924bca1725;_$LT$collections..vec..Vec$LT$T$GT$$GT$::extend_desugared::h5bbb8e6b5a245d7f;_$LT$collections..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..DerefMut$GT$::deref_mut::h1489b09ee24485ec 1
emulator;__rust_maybe_catch_panic;emulator::main::hc2aaa9b4591a10c7;emulator::main_ret::hc4b7fa9090639ebe;simplelog::termlog::TermLogger::init::ha7463b1622ff979e;log::set_logger::hfce3bfc5d262a203;log::set_logger_raw::h2040ab7e0793ea3f;log::set_logger::_$u7b$$u7b$closure$u7d$$u7d$::hcb7821323b596727;simplelog::termlog::TermLogger::init::_$u7b$$u7b$closure$u7d$$u7d$::h347f6695ed91405f;simplelog::termlog::TermLogger::new::h94d15a7bc0cbc21f;term::stdout::hc71a921b9549a869;_$LT$term..terminfo..TerminfoTerminal$LT$T$GT$$GT$::new::h52a3a52cf0fd4041;term::terminfo::TermInfo::from_env::h7aa5bbfa652bcb0d;term::terminfo::TermInfo::from_name::h721edfed0d4e6840;_$LT$core..result..Result$LT$T$C$$u20$E$GT$$GT$::and_then::h47fa4b8545196b9b;term::terminfo::TermInfo::from_name::_$u7b$$u7b$closure$u7d$$u7d$::hbdb8aa57609652e0;term::terminfo::TermInfo::from_path::hc007f27f9c5301db;term::terminfo::TermInfo::_from_path::h51064971a80093cd;term::terminfo::parser::compiled::parse::h0bfa24a8d6483291;core::iter::iterator::Iterator::collect::h6ce9ad9125cfc58e;_$LT$core..result..Result$LT$V$C$$u20$E$GT$$u20$as$u20$core..iter..traits..FromIterator$LT$core..result..Result$LT$A$C$$u20$E$GT$$GT$$GT$::from_iter::h16fe3c65a4c16e46;_$LT$std..collections..hash..map..HashMap$LT$K$C$$u20$V$C$$u20$S$GT$$u20$as$u20$core..iter..traits..FromIterator$LT$$LP$K$C$$u20$V$RP$$GT$$GT$::from_iter::h84d1c44a62ed8a23;_$LT$std..collections..hash..map..HashMap$LT$K$C$$u20$V$C$$u20$S$GT$$u20$as$u20$core..iter..traits..Extend$LT$$LP$K$C$$u20$V$RP$$GT$$GT$::extend::h0c6331f8890ff8d7;_$LT$std..collections..hash..map..HashMap$LT$K$C$$u20$V$C$$u20$S$GT$$GT$::insert::hcb451fe86918197e;_$LT$std..collections..hash..map..HashMap$LT$K$C$$u20$V$C$$u20$S$GT$$GT$::insert_hashed_nocheck::h98844db7b829b7c9;std::collections::hash::map::search_hashed::hb56562c80a350a98;_$LT$std..collections..hash..table..Bucket$LT$K$C$$u20$V$C$$u20$M$GT$$GT$::new::h610d20a99611ae46;_$LT$std..collections..hash..table..Bucket$LT$K$C$$u20$V$C$$u20$M$GT$$GT$::at_index::h34ab787a9a6009ea;_$LT$std..collections..hash..table..RawTable$LT$K$C$$u20$V$GT$$GT$::first_bucket_raw::hb9d07d7e2fb8d059;std::collections::hash::table::calculate_offsets::hfe569e8904133a1b;core::num::_$LT$impl$u20$usize$GT$::overflowing_add::h4bf465fac5e6d437 1
emulator;__rust_maybe_catch_panic;emulator::main::hc2aaa9b4591a10c7;emulator::main_ret::hc4b7fa9090639ebe;simplelog::termlog::TermLogger::init::ha7463b1622ff979e;log::set_logger::hfce3bfc5d262a203;log::set_logger_raw::h2040ab7e0793ea3f;log::set_logger::_$u7b$$u7b$closure$u7d$$u7d$::hcb7821323b596727;simplelog::termlog::TermLogger::init::_$u7b$$u7b$closure$u7d$$u7d$::h347f6695ed91405f;simplelog::termlog::TermLogger::new::h94d15a7bc0cbc21f;term::stdout::hc71a921b9549a869;_$LT$term..terminfo..TerminfoTerminal$LT$T$GT$$GT$::new::h52a3a52cf0fd4041;term::terminfo::TermInfo::from_env::h7aa5bbfa652bcb0d;term::terminfo::TermInfo::from_name::h721edfed0d4e6840;_$LT$core..result..Result$LT$T$C$$u20$E$GT$$GT$::and_then::h47fa4b8545196b9b;term::terminfo::TermInfo::from_name::_$u7b$$u7b$closure$u7d$$u7d$::hbdb8aa57609652e0;term::terminfo::TermInfo::from_path::hc007f27f9c5301db;term::terminfo::TermInfo::_from_path::h51064971a80093cd;term::terminfo::parser::compiled::parse::h0bfa24a8d6483291;std::io::Read::read_to_end::hf3e43392e443d646;std::io::read_to_end::heeed5f53db31e2d5;_$LT$collections..vec..Vec$LT$T$GT$$GT$::resize::h33edb9dae7314c90;_$LT$collections..vec..Vec$LT$T$GT$$GT$::extend_with_element::hadc3afe1b04eb21a;core::ptr::_$LT$impl$u20$$BP$mut$u20$T$GT$::offset::h83331dc01d57b6ff 1
emulator;__rust_maybe_catch_panic;emulator::main::hc2aaa9b4591a10c7;simplelog::termlog::TermLogger::init::ha7463b1622ff979e;page_fault+0xfe200000_[k] 1
emulator;__rust_maybe_catch_panic;emulator::main::hc2aaa9b4591a10c7;simplelog::termlog::TermLogger::init::ha7463b1622ff979e;page_fault_[k] 1
emulator;_dl_map_object;_dl_load_cache_lookup 2
emulator;_dl_start_user;_dl_start 1
emulator;_start 6
emulator;_start;page_fault+0xfe200000_[k] 1
emulator;_start;page_fault_[k] 1
emulator;je_arena_ralloc_no_move 1
emulator;je_arena_tcache_fill_small;page_fault+0xfe200000_[k] 1
emulator;je_arena_tcache_fill_small;page_fault_[k] 1
emulator;je_tcache_boot 1

0 comments on commit ef64564

Please sign in to comment.