Open zamazan4ik opened 12 months ago
You can either collect perf profile that would include samples in your shared library, or you can instrument that shared library the same way as you would instrument an executable.
I assume you know where to look for instrumentation profile: by default it's in /tmp/prof.fdata
, otherwise it can be set with --instrumentation-file
option.
Instrumentation profile is normally dumped via hook to _fini
which requires a graceful exit. You can modify the default behavior and dump the profile at regular intervals using --instrumentation-sleep-time
option. Let me know if it helps.
Hi!
From the README file right now it's not clear how to use BOLT properly for optimizing shared libraries.
I have a case where I want to optimize with BOLT a shared library but I have no possibility to instrument the calling this binary library (because it could be simply a Python interpreter).
Is it possible in this case to optimize the library with BOLT? If yes, are there any special additional steps for that? I have tried to instrument the library and call it from a non-instrumented binary - no profiles are written to the disk.
I expect something like it's already done for the Instrumentation PGO in Clang (PGO profiles are dumped to the disk for each instrumented shared library after the library unload).