Using the C SDK #1433
-
|
Hola! Nice to chat to you all again :) I am looking into using the Perfetto SDK to instrument some code that is a bit of a mix of languages, so I will need to write some wrappers, similar to what you seem to have started with the android_sdk. Using the C++ SDK forces me to define all trace categories in one C++ header file (or multiple when using namespaces but that means I now have multiple datasources registered). This is a bit inconvenient as I might want to define categories in one of the other languages (e.g. Java). I see that you are using the new libperfetto_c library for your android_sdk project, and in fact the c SDK has a nicer API to register categories. That made me consider using the C API instead but all I could find about it is a mention in the docs “A C SDK is under active development and should be available for general usage by Q2 2023”. So I have a couple questions related to this C SDK.
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hi!
Yes, as much as the C++ API at this point.
Mostly. We had one ABI breakage since the code was checked in, but zero API breakages. I don't expect API breakages in the future.
None at all. You can statically link the code.
Disadvantages of the C API compared to the C++ API:
Advantages of the C API:
It's the start of a java API, mostly for android. Not stable yet.
No plans. I'd love to be proven wrong, but I don't think this can be retrofitted easily at this point. Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hi!
Yes, as much as the C++ API at this point.
Mostly. We had one ABI breakage since the code was checked in, but zero API breakages. I don't expect API breakages in the future.
None at all. You can statically link the code.
Disadvantages of the C API compared to the C++ API: