-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracing DLLs in in-process mode #712
Comments
Hi! By linking statically the perfetto library to two separate DLLs, you're effectively creating two separate instances of the library, so the behavior you're observing is expected. The most straightforward solution would be to avoid dynamic linking at all, that's what perfetto was originally designed for. I'm not sure it's an option in your case, though. You can try linking dynamically, but the C++ annotations for dynamic linking (PERFETTO_EXPORT_COMPONENT) are supported on a best effort basis, mostly for tests. Lastly, you can use the more restricted C API in Those are the options at the moment, I believe. Let me know if you have any questions. |
Thank you for this information! I'll try dynamic linking (although it's not fully supported). Does |
Not really, you can have separate |
I am tracing my C++ application on Windows by following https://perfetto.dev/docs/instrumentation/tracing-sdk#recording and this example https://github.com/google/perfetto/blob/master/examples/sdk/example.cc (Tracing through the API in the in-process mode).
My application links to a DLL (let calls it foo.dll which built from foo.cpp).
I called
tracing_session->StartBlocking()
in the main function (example.cc) and addedTRACE_EVENT
in both example.cc and foo.cpp.However, the trace result only contains the the trace from the example.cc but not foo.cpp.
Any suggestions?
Minimal code to show what I did (modified from https://github.com/google/perfetto/blob/master/examples/sdk/example.cc):
The text was updated successfully, but these errors were encountered: