Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions thermal_monitor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ class ThresholdSessionObserver final : public perfetto::TrackEventSessionObserve
};

void EmitCounter(const char* name, double value) {
// The names are ThermalConstants string literals, so they outlive the track.
TRACE_COUNTER(ThermalConstants::kTrackEventCategory, perfetto::CounterTrack(perfetto::StaticString{name}), value);
// Thermal state belongs to the device, not to this process, so the counters go on global tracks
// (the default parent would be this process's track). The names are ThermalConstants string
// literals, so they outlive the track.
TRACE_COUNTER(ThermalConstants::kTrackEventCategory, perfetto::CounterTrack(perfetto::StaticString{name}, perfetto::Track()),
value);
}

volatile std::sig_atomic_t g_stop_requested = 0;
Expand Down
Loading