diff --git a/Cargo.lock b/Cargo.lock index df3796fc..f44bb0c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,8 +8,8 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ - "fallible-iterator", - "gimli", + "fallible-iterator 0.2.0", + "gimli 0.27.3", ] [[package]] @@ -50,6 +50,12 @@ version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "assert-json-diff" version = "2.0.2" @@ -440,6 +446,12 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.2.8" @@ -467,6 +479,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "1.8.0" @@ -515,13 +533,16 @@ dependencies = [ [[package]] name = "framehop" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3cae7151aeb94b1e204677f528adf6f6c56c0f56dbc5661c910b1f7deab806" +checksum = "100be025a95edcb72ccc909b46131fc4dc63fb1e3b2c66a17daa76e962df530a" dependencies = [ - "fallible-iterator", - "gimli", - "macho-unwind-info", + "arrayvec", + "fallible-iterator 0.3.0", + "gimli 0.28.1", + "macho-unwind-info 0.4.0", + "object 0.32.1", + "pe-unwind-info", "thiserror", ] @@ -676,8 +697,18 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ - "fallible-iterator", - "indexmap", + "fallible-iterator 0.2.0", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator 0.3.0", + "indexmap 2.1.0", "stable_deref_trait", ] @@ -693,7 +724,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.2", "slab", "tokio", "tokio-util", @@ -715,6 +746,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "heck" version = "0.4.0" @@ -821,6 +858,16 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + [[package]] name = "inplace-vec-builder" version = "0.1.1" @@ -982,7 +1029,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29014be9ddec1a1e9bfbb926493d2df811adc2e257a5a36072136eb84c19c14f" dependencies = [ "thiserror", - "zerocopy", + "zerocopy 0.6.1", +] + +[[package]] +name = "macho-unwind-info" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b6086acc74bc23f56b60e88bb082d505e23849d68d6c0f12bb6a7ad5c60e03e" +dependencies = [ + "thiserror", + "zerocopy 0.7.32", + "zerocopy-derive 0.7.32", ] [[package]] @@ -1124,8 +1182,19 @@ dependencies = [ "crc32fast", "flate2", "hashbrown 0.13.2", - "indexmap", + "indexmap 1.9.2", + "memchr", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "flate2", "memchr", + "ruzstd", ] [[package]] @@ -1194,11 +1263,24 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00e30e131bcab0d41a2e471cf777ea9b1402f2a0764bcf1780251eab1b0d175d" dependencies = [ - "fallible-iterator", + "fallible-iterator 0.2.0", "scroll", "uuid", ] +[[package]] +name = "pe-unwind-info" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00503160cacc009a96696645b4acc6d8fdc7a3f3a3120eb2e08a8ec5234bc2e7" +dependencies = [ + "arrayvec", + "bitflags 2.1.0", + "thiserror", + "zerocopy 0.7.32", + "zerocopy-derive 0.7.32", +] + [[package]] name = "percent-encoding" version = "2.2.0" @@ -1255,9 +1337,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -1276,9 +1358,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1380,7 +1462,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1487,6 +1569,17 @@ dependencies = [ "base64", ] +[[package]] +name = "ruzstd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" +dependencies = [ + "byteorder", + "thiserror-core", + "twox-hash", +] + [[package]] name = "ryu" version = "1.0.12" @@ -1526,7 +1619,7 @@ dependencies = [ "nix", "nix-base32", "num_cpus", - "object", + "object 0.30.2", "once_cell", "opener", "parking_lot", @@ -1579,15 +1672,15 @@ dependencies = [ "elsa", "flate2", "futures", - "gimli", + "gimli 0.27.3", "linux-perf-data", "lzma-rs", - "macho-unwind-info", + "macho-unwind-info 0.3.0", "memchr", "memmap2", "msvc-demangler", "nom", - "object", + "object 0.30.2", "pdb-addr2line", "rangemap", "rustc-demangle", @@ -1595,7 +1688,7 @@ dependencies = [ "thiserror", "uuid", "yoke", - "zerocopy", + "zerocopy 0.6.1", ] [[package]] @@ -1637,7 +1730,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1790,9 +1883,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1866,22 +1959,42 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] +[[package]] +name = "thiserror-core" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c001ee18b7e5e3f62cbf58c7fe220119e68d902bb7443179c0c8aef30090e999" +dependencies = [ + "thiserror-core-impl", +] + +[[package]] +name = "thiserror-core-impl" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.48", ] [[package]] @@ -1940,7 +2053,7 @@ checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2000,6 +2113,16 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + [[package]] name = "uname" version = "0.1.1" @@ -2492,7 +2615,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "332f188cc1bcf1fe1064b8c58d150f497e697f49774aa846f2dc949d9a25f236" dependencies = [ "byteorder", - "zerocopy-derive", + "zerocopy-derive 0.3.2", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "byteorder", + "zerocopy-derive 0.7.32", ] [[package]] @@ -2506,6 +2639,17 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "zerofrom" version = "0.1.1" diff --git a/samply/Cargo.toml b/samply/Cargo.toml index 66be8cb4..c8fb0247 100644 --- a/samply/Cargo.toml +++ b/samply/Cargo.toml @@ -12,8 +12,8 @@ readme = "README.md" [dependencies] fxprof-processed-profile = { version = "0.6", path = "../fxprof-processed-profile" } -# framehop = { path = "../../framehop" } -framehop = "0.7.2" +# framehop = { path = "../../framehop", features = ["object"] } +framehop = { version = "0.8.0", features = ["object"] } # linux-perf-data = { path = "../../linux-perf-data" } linux-perf-data = "0.8.2" diff --git a/samply/src/linux_shared/converter.rs b/samply/src/linux_shared/converter.rs index 96fb4cff..f02a9f14 100644 --- a/samply/src/linux_shared/converter.rs +++ b/samply/src/linux_shared/converter.rs @@ -1,7 +1,7 @@ use byteorder::LittleEndian; use debugid::{CodeId, DebugId}; -use framehop::{FrameAddress, Module, ModuleSvmaInfo, ModuleUnwindData, TextByteData, Unwinder}; +use framehop::{ExplicitModuleSectionInfo, FrameAddress, Module, Unwinder}; use fxprof_processed_profile::{ CpuDelta, LibraryInfo, Profile, ReferenceTimestamp, SamplingInterval, ThreadHandle, }; @@ -1044,39 +1044,26 @@ where }; let text = file.section_by_name(".text"); - let text_env = file.section_by_name("text_env"); let eh_frame = file.section_by_name(".eh_frame"); let got = file.section_by_name(".got"); let eh_frame_hdr = file.section_by_name(".eh_frame_hdr"); - let unwind_data = match ( - eh_frame - .as_ref() - .and_then(|s| section_data(s, mmap.clone())), - eh_frame_hdr - .as_ref() - .and_then(|s| section_data(s, mmap.clone())), - ) { - (Some(eh_frame), Some(eh_frame_hdr)) => { - ModuleUnwindData::EhFrameHdrAndEhFrame(eh_frame_hdr, eh_frame) - } - (Some(eh_frame), None) => ModuleUnwindData::EhFrame(eh_frame), - (None, _) => ModuleUnwindData::None, - }; + let eh_frame_data = eh_frame + .as_ref() + .and_then(|s| section_data(s, mmap.clone())); + let eh_frame_hdr_data = eh_frame_hdr + .as_ref() + .and_then(|s| section_data(s, mmap.clone())); let text_data = if let Some(text_segment) = file .segments() .find(|segment| segment.name_bytes() == Ok(Some(b"__TEXT"))) { let (start, size) = text_segment.file_range(); - let address_range = base_avma + start..base_avma + start + size; MmapRangeOrVec::new_mmap_range(mmap.clone(), start, size) - .map(|data| TextByteData::new(data, address_range)) } else if let Some(text_section) = &text { if let Some((start, size)) = text_section.file_range() { - let address_range = base_avma + start..base_avma + start + size; MmapRangeOrVec::new_mmap_range(mmap.clone(), start, size) - .map(|data| TextByteData::new(data, address_range)) } else { None } @@ -1088,24 +1075,28 @@ where section.address()..section.address() + section.size() } - let module_svma_info = ModuleSvmaInfo { + let module_section_info = ExplicitModuleSectionInfo { base_svma, - text: text.as_ref().map(svma_range), - text_env: text_env.as_ref().map(svma_range), - stubs: None, - stub_helper: None, - eh_frame: eh_frame.as_ref().map(svma_range), - eh_frame_hdr: eh_frame_hdr.as_ref().map(svma_range), - got: got.as_ref().map(svma_range), + text_svma: text.as_ref().map(svma_range), + text: text_data, + stubs_svma: None, + stub_helper_svma: None, + got_svma: got.as_ref().map(svma_range), + unwind_info: None, + eh_frame_svma: eh_frame.as_ref().map(svma_range), + eh_frame: eh_frame_data, + eh_frame_hdr_svma: eh_frame_hdr.as_ref().map(svma_range), + eh_frame_hdr: eh_frame_hdr_data, + debug_frame: None, + text_segment_file_range: None, + text_segment: None, }; let module = Module::new( path.to_string(), avma_range.clone(), base_avma, - module_svma_info, - unwind_data, - text_data, + module_section_info, ); process.unwinder.add_module(module);