perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

How to add different timestamp starting points in a trace file?

Open ManiacLook opened this issue 1 year ago • 1 comments

In the obtained trace file, there is a definition of clock_stnapshot, which I noticed determines a timestamp starting point a. When the packet is displayed in the UI, the actual time will be added to this starting point a(a = 1748331084613773189 - 77356819026675). For example, the timestamp of packet in the following figure is 77357337586986, but its actual timestamp is (1748331084613773189 - 77356819026675 + 77357337586986).

There are many packets in a trace file, and I want to divide them into multiple continuous parts, each with a different time starting point. Is this achievable? I tried inserting a clock_stnapshot in the middle packet to specify a new time starting point, but it didn't work. Is there any other way?

Image Image

ManiacLook avatar May 28 '25 09:05 ManiacLook

This is a misunderstanding of clock_snpashot: it does not define the "starting point" for anything. It just tells us "at this timestamp, this is the state of all the clocks". We use this to perform clock synchronization as described at https://perfetto.dev/docs/concepts/clock-sync

Splitting a Perfetto trace is a hard problem and is tracked by https://github.com/google/perfetto/issues/951

LalitMaganti avatar May 28 '25 09:05 LalitMaganti