info@virtualmetrix.com

This is a short tutorial that presents how you can monitor the SoC power information in an Android system.

1. Power Data

The power data consists in:

  • power information obtained from the battery using I2C

 

2. Android /sys entries

The data is exposed through specific /sys entries that are available on most of the Android Linux kernels (but not on all of them), so when using the kernel you have to check the entry first if it is available.

For example in a LG Nexus_5 phone we have the following available /sys entries for power:

  • Voltage: /sys/class/power_supply/battery/voltage_now
  • Current: /sys/class/power_supply/battery/current_now

 

3. Data monitoring

 Data is polled from the /sys entries and is displayed in the XPerf application as below.

3.1 Power data displayed by XPerf application

xperf single channel