Clock domain of TracingServiceEvent timestamps when primary_trace_clock is not BOOTTIME #7112
|
Hi, I’m trying to confirm the expected clock handling for TracingServiceEvent timestamps. TracingServiceImpl captures lifecycle event timestamps using GetBootTimeNs() and emits the packet without timestamp_clock_id:
TracePacket definition says that, when neither the packet nor its sequence defaults specify a clock, timestamp_clock_id defaults to BOOTTIME:
ProtoTraceReader handles service_event before the normal timestamp conversion path and passes the packet timestamp directly to ParseServiceEvent:
Consider a clock snapshot where BOOTTIME 1000 corresponds to MONOTONIC_RAW 100, with MONOTONIC_RAW selected as primary_trace_clock. If tracing_started has timestamp 1050 and no timestamp_clock_id, should tracing_started_ns be converted to 150? The current code appears to store 1050. This seems related to issue #3705 and #3709, but the special service-event path bypasses the normal packet timestamp handling. Am I missing an invariant that makes these timestamps already expressed in the primary trace clock, or should Trace Processor convert them from BOOTTIME? |
Replies: 3 comments 1 reply
This comment was marked as low quality.
This comment was marked as low quality.
No you're not missing anything, this is indeed a missing conversion! Will send a change to fix this :) |
|
Thanks Lalit! much appreciated. I checked #7117 and it covers the case I was seeing. Setting BOOTTIME explicitly on service packets also makes the intent much clearer. |
No you're not missing anything, this is indeed a missing conversion! Will send a change to fix this :)