-
Notifications
You must be signed in to change notification settings - Fork 567
Description
Context:
Currently power rails streams are typically divided into two kinds of packets:
- RailDescriptors
- EnergyData
See: https://perfetto.dev/docs/reference/trace-packet-proto#PowerRails
EnergyData is asociated with the RailDescriptors using a integer rail index, which allows mapping the energy data to a specific rail name.
Problem
Currently the rail parser is implemented such that the rail index is assumed to be globally unique for the trace. this presents issues when two independent power rail streams are present in the trace that overlap in terms of their indices.
This currently results in undefined behavior at import time, which tends to manifest as a mixture of power railsempty tracks plus some other tracks that contain energy samples from both streams, resulting in nonsensical power data.
Proposed solution
instead of keying on a unique index to map to track ids, instead map unique pairs of the sequence_id and index to track_ids. The assumption here is that each stream would be coming for a different datasource, and thus have a different sequence id.
Namely looks like we would need modifications to both the setter and getter here and the pipe the sequence id to those functions
Is there any concern with the above approach, or other alternatives worth considering?