Skip to content

Handling independent power rail streams #2629

@cphlipot1

Description

@cphlipot1

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions