Skip to content

Commit

Permalink
Add support for reading symbols from simpleperf files.
Browse files Browse the repository at this point in the history
This includes Java and kernel symbols, if available.
  • Loading branch information
mstange committed Apr 25, 2024
1 parent 30af502 commit 57d3653
Show file tree
Hide file tree
Showing 8 changed files with 244 additions and 23 deletions.
43 changes: 41 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samply-symbols/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ yoke-derive = "0.7"
nom = "7.1.1"
zerocopy = "0.7"
zerocopy-derive = "0.7"
linux-perf-data = "0.9.0"
linux-perf-data = "0.10.0"

[dev-dependencies]
memmap2 = "0.9.4"
Expand Down
1 change: 1 addition & 0 deletions samply-symbols/src/demangle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::demangle_ocaml;
use msvc_demangler::DemangleFlags;

/// Attempt to demangle the passed-in string. This tries a bunch of different demangling schemes.
pub fn demangle_any(name: &str) -> String {
if name.starts_with('?') {
let flags = DemangleFlags::NO_ACCESS_SPECIFIERS
Expand Down
1 change: 1 addition & 0 deletions samply-symbols/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ pub use crate::breakpad::{
pub use crate::cache::{FileByteSource, FileContentsWithChunkedCaching};
pub use crate::compact_symbol_table::CompactSymbolTable;
pub use crate::debugid_util::{debug_id_for_object, DebugIdExt};
pub use crate::demangle::demangle_any;
pub use crate::error::Error;
pub use crate::external_file::{load_external_file, ExternalFileSymbolMap};
pub use crate::jitdump::debug_id_and_code_id_for_jitdump;
Expand Down
2 changes: 1 addition & 1 deletion samply/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fxprof-processed-profile = { version = "0.7", path = "../fxprof-processed-profil
# framehop = { path = "../../framehop" }
framehop = "0.11.1"
# linux-perf-data = { path = "../../linux-perf-data" }
linux-perf-data = "0.9.0"
linux-perf-data = "0.10.0"

tokio = { version = "1.37.0", features = ["rt", "rt-multi-thread", "macros"] }
tokio-util = "0.7.10"
Expand Down
2 changes: 2 additions & 0 deletions samply/src/import/perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ where
eprintln!("event {event_name}");
}
let interpretation = EventInterpretation::divine_from_attrs(attributes);
let simpleperf_symbol_tables = perf_file.simpleperf_symbol_tables().ok().flatten();

let mut converter = Converter::<U>::new(
&profile_creation_props,
Expand All @@ -115,6 +116,7 @@ where
cache,
extra_dir,
interpretation.clone(),
simpleperf_symbol_tables,
);

let mut last_timestamp = 0;
Expand Down
1 change: 1 addition & 0 deletions samply/src/linux/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ fn make_converter(
framehop::CacheNative::new(),
None,
interpretation,
None,
)
}

Expand Down
Loading

0 comments on commit 57d3653

Please sign in to comment.