unit_multiplier_ns in clock_snapshot is not correctly handled by perfetto UI
Hi Perfetto Team,
Background:
I recorded a perfetto trace according to perfetto trace_packet format. This trace is not generated by perfetto or chrome. Instead, it is generated by one of my customized tool. I use perfetto trace format so I can make good use of perfetto ui for visualization.
Observation:
According to clock_snapshot.proto, message
message ClockSnapShot {
...
// Allows to specify a custom unit different than the default (ns) for this
// clock domain. A multiplier of 1000 means that a timestamp = 3 should be
// interpreted as 3000 ns = 3 us. All snapshots for the same clock within a
// trace need to use the same unit.
optional uint64 unit_multiplier_ns = 4;
...
}
So I added a clock snapshot and use a customized time unit. Also I set unit_multiplier_ns. I then recorded statsd atoms according to statsd_trace_config.proto. But it seem perfetto ui can't handle it correctly.
https://cs.android.com/android/platform/superproject/main/+/main:external/perfetto/protos/perfetto/trace/clock_snapshot.proto;l=24?q=ClockSnapshot&sq=&ss=android%2Fplatform%2Fsuperproject%2Fmain
My trace is attached. Part of the content converted to pbtxt is as follows:
packet {
clock_snapshot {
clocks {
clock_id: REALTIME
timestamp: 1700722664876
unit_multiplier_ns: 1000000
}
clocks {
clock_id: BOOTTIME
timestamp: 264795078
unit_multiplier_ns: 1000000
}
}
}
Attached trace: unit_multiplier_ns_not_working.trace.zip
Hi @wangjiyang, thanks for reporting. This looks like a bug. @aMayzner is taking a look
Fixed in https://r.android.com/2849742. It is available in Autopush now and will be included in next release.
@stevegolton @aMayzner Thanks for your quick response.