Recording thermal counters in a trace

Overview

Fuchsia tracing can capture temperature sensor readings when supported by the hardware. These readings appear as counters in the trace data and are valuable for two primary reasons:

  • Ensuring physical comfort - Devices that come into contact with people or sensitive environments should not overheat.
  • Indicating power consumption - Heat generation is a general byproduct of power consumption and can serve as an indirect measure of power usage.

Enabling thermal counters

Temperature sampling is not enabled by default. To enable temperature sampling, run the following command prior to capturing the trace:

ffx profile temperature logger start -s 500ms

Capture the trace

For general information on Fuchsia tracing and how to capture trace events with ffx trace, see Fuchsia tracing.

To include thermal counter data in your trace, specify the metrics_logger category:

ffx trace start --categories "#default,metrics_logger"