google / perfetto

Performance instrumentation and tracing for Android, Linux and Chrome (read-only mirror of https://android.googlesource.com/platform/external/perfetto/)
https://www.perfetto.dev
Apache License 2.0
2.84k stars 354 forks source link

Multiple identical data sources #390

Open djdeath opened 1 year ago

djdeath commented 1 year ago

I have a system with multiple GPUs (multiple of the same vendor). I would like to create a data source for each of the GPU to report metrics, but it seems at the moment I have to create a data source class for each one.

I've tried to instantiate the data source class multiple times for each GPU, each with a different name, but it seems that the second instances are not visible to the perfetto system.

Is there a way to achieve this without creating multiple classes?

LalitMaganti commented 1 year ago

Can you provide more concrete examples of what your classes/configs look like? It's a bit hard to parse exactly what issue you are facing atm.

@ddiproietto FYI.

djdeath commented 1 year ago

Sure, I have this GpuDataSource class : https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/tool/pps/pps_datasource.h#L31

And what I would like to do is to register it multiple times like this : https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/tool/pps/pps_datasource.cc#L144

So far if I register more than once, even with different source name, the second one is never started, even if its name is in the perfetto config file.