Repository navigation
async-profiler does not hook indirect dlopens #1685
yanglong1010
started this conversation in
General
Replies: 1 comment
|
You are right: async-profiler does not immediately track shared objects dlopen'ed from libraries other than
As you've mentioned, this problem is rare, and it is automatically solved upon starting the next profiling session. So I'm inclined not to fix it unless you know a simple and safe approach to tackle this. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I encountered this problem by chance, not in a real-world scenario.
The cpu profile produced by perf is like this:

If take cpu profile, all cstack modes fail to walk the methods of lib2 and lib3.

If take native mem profile, all mallocs in lib2 and lib3 are missing.
The probability of this case is very low. I just wonder it is necessary to add this missing piece.
In addition to hook every dlopen, some other details needs to be handled carefully. Such as RPATH, if libA dlopens libB, glibc reads the RAPTH from libA and uses it to search libB. if dlopen is hooked by async-profiler, the caller of dlopen becomes async-profiler rather than libA, async-profiler should walk the RPATH of libA manually to find libB, then invokes dlopen with the absolute path.
All reactions