Skip to content

Commit

Permalink
handle missing energy tracks case (#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
kocdemir authored Sep 15, 2022
1 parent 1f3ea92 commit 8ca26d6
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,23 @@ public static Perfetto.Data.Builder enumerate(Perfetto.Data.Builder data) {
.map(Map.Entry::getValue)
.collect(Collectors.toList());

String energyBreakdownGroup = "energy_breakdown_group";
data.tracks.addLabelGroup(
null,
energyBreakdownGroup,
"Energy Breakdown",
group(state -> new TitlePanel("Energy Breakdown"), true));
for (CounterInfo energy : energyTracks) {
EnergyBreakdownTrack energyTrack = new EnergyBreakdownTrack(data.qe, energy);
data.tracks.addTrack(
if(energyTracks.size() > 0) { //TODO: handle in a better way
String energyBreakdownGroup = "energy_breakdown_group";
data.tracks.addLabelGroup(
null,
energyBreakdownGroup,
energyTrack.getId(),
energy.name,
single(state -> new EnergyBreakdownPanel(state, energyTrack, 50), true, true));
"Energy Breakdown",
group(state -> new TitlePanel("Energy Breakdown"), true));
for (CounterInfo energy : energyTracks) {
EnergyBreakdownTrack energyTrack = new EnergyBreakdownTrack(data.qe, energy);
data.tracks.addTrack(
energyBreakdownGroup,
energyTrack.getId(),
energy.name,
single(state -> new EnergyBreakdownPanel(state, energyTrack, 50), true, true));
}
}

return data;
}

Expand Down

0 comments on commit 8ca26d6

Please sign in to comment.