polarsignals / rust-jemalloc-pprof Goto Github PK
View Code? Open in Web Editor NEWConvert jemalloc heap profiles to pprof to understand memory usage, fix memory leaks, and fix OOM Kills.
License: Apache License 2.0
Convert jemalloc heap profiles to pprof to understand memory usage, fix memory leaks, and fix OOM Kills.
License: Apache License 2.0
Hey! I'm seeing this on M1 mac:
error[E0432]: unresolved imports `libc::dl_iterate_phdr`, `libc::dl_phdr_info`, `libc::Elf64_Word`, `libc::PT_LOAD`, `libc::PT_NOTE`
--> /Users/jack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jemalloc_pprof-0.1.0/src/linux.rs:27:20
|
27 | use libc::{c_void, dl_iterate_phdr, dl_phdr_info, size_t, Elf64_Word, PT_LOAD, PT_NOTE};
| ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^ ^^^^^^^ no `PT_NOTE` in the root
| | | | |
| | | | no `PT_LOAD` in the root
| | | no `Elf64_Word` in the root
| | no `dl_phdr_info` in the root
| no `dl_iterate_phdr` in the root
error[E0609]: no field `p_type` on type `&_`
--> /Users/jack/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jemalloc_pprof-0.1.0/src/linux.rs:225:15
|
225 | if ph.p_type == PT_LOAD {
| ^^^^^^
Edits from Brennan:
I'm repurposing this issue to "support macOS". The original issue is below.
The main thing we need to do to support macOS is provide something like linux::collect_shared_objects
for macOS. This can probably done using the functions documented in dyld(3).
Hi peeps,
I am looking for some guidance on how to run pprof on macos,
I have a rust app configured as follows:
[profile.release]
lto = "thin"
debug = 1 # Line tables only.
tikv-jemalloc-ctl = { version = "0.5" }
tikv-jemalloc-sys = { version = "0.5", features = ["profiling"] }
tikv-jemallocator = { version = "0.5", features = ["profiling"] }
[target.'cfg(not(target_os = "macos"))'.dependencies]
jemalloc_pprof = "0.1.0"
#[cfg(not(target_os = "macos"))]
{
router = router.route("/debug/pprof/heap", get(web::pprof::pprof_heap));
}
port-forward on the pod
run go tool pprof http://localhost:9200/debug/pprof/heap
locally, it throws:
Fetching profile over HTTP from http://localhost:9200/debug/pprof/heap
Local symbolization failed for app (build ID 9d67e10139bad60c021451c99d19ec33b08f8a67): open /usr/local/bin/app: no such file or directory
Local symbolization failed for libpthread.so.0 (build ID 255e355c207aba91a59ae1f808e3b4da443abf0c): open /lib/x86_64-linux-gnu/libpthread.so.0: no such file or directory
Local symbolization failed for libc.so.6 (build ID a3780b0b8a5bf5876e31d16b0a9d8fc6ba69a1f2): open /lib/x86_64-linux-gnu/libc.so.6: no such file or directory
Some binary filenames not available. Symbolization may be incomplete.
Try setting PPROF_BINARY_PATH to the search path for local binaries.
http post http://localhost:9200/debug/pprof/symbol: server response: 404 Not Found
the mechanics of how all this connects is quite hazy for me, but it looks like app binary does not have symbols and that is causing the local symbolization to fail,
question: is that due to #[cfg(not(target_os = "macos"))]
? pprof works for the cpu profile, indicating the app binary has the correct symbols *maybe?
btw, for testing, I've copied the binary locally, and open /usr/local/bin/app: no such file or directory
was gone, the other two remained
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.