diff --git a/Cargo.lock b/Cargo.lock index 5a493fa7..cc081dea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -966,6 +966,16 @@ version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" +[[package]] +name = "page_size" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "parking_lot_core" version = "0.9.8" @@ -1080,6 +1090,7 @@ dependencies = [ "log", "lru", "memmap", + "page_size", "proc-maps", "py-spy-testdata", "rand", diff --git a/Cargo.toml b/Cargo.toml index cdfbd569..084afaf5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ log = "0.4" lru = "0.10" regex = ">=1.6.0" tempfile = "3.6.0" +page_size = "0.6.0" proc-maps = "0.3.2" memmap = "0.7.0" cpp_demangle = "0.4" diff --git a/src/binary_parser.rs b/src/binary_parser.rs index 057fed67..5785579d 100644 --- a/src/binary_parser.rs +++ b/src/binary_parser.rs @@ -124,9 +124,10 @@ pub fn parse_binary(filename: &Path, addr: u64, size: u64) -> Result