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.78k stars 348 forks source link

Detailed instruction/example on custom timestamp types support in perfetto SDK #377

Open horusli opened 1 year ago

horusli commented 1 year ago

Hi perfetto team,

In perfetto sdk document there is some brief note that custom timestamp type is supported in perfetto sdk.

|time_in_nanoseconds| should be an uint64_t by default. To support custom timestamp types, |perfetto::TraceTimestampTraits::ConvertTimestampToTraceTimeNs| should be defined. See |ConvertTimestampToTraceTimeNs| for more details.

but I do not find more detailed explaination of it usage in the src code or integrationtest.

Do we have more detailed instruction or example on how to use it to convert custom timestamp to the display timeline, or even better to user defined timestamp on the analysis timeline?

thanks in advance.

LalitMaganti commented 1 year ago

Ack this is a fair ask. @betasheet FYi.