PowerHAL: add debug support for low power stats

The HAL API includes a "debug" interface that can be invoked from the
command line to get debug output for a particular HAL.  While the
existing PowerHAL implementation includes support for the "debug"
interface, it only includes data for the performance hinting side of the
HAL.  To facilitate device troubleshooting (not just of the HAL itself,
but of power drain), this change expands that implementation to also
include the output from calls to getPlatformLowPowerStats() and
getSubsystemLowPowerStats().

On existing in-market devices where this support is present, the command
    lshal debug android.hardware.power@1.3::IPower/default
will produce the "debug" output.

The code for dumping the PowerHAL stats data is generic across
device-specific PowerHAL implementations, so it is all pushed up into a
new library (see topic CLs) that will eventually host additional
PowerHAL implementation code.

Bug: 116750864
Test: Ran code on an active P17 device.
Test: Added temporary test code (triggered by appending " test" to the
command above) to cover all base cases of data being present absent
(test code is included in first uploaded patchset on the corresponding
crosshatch CL).

Change-Id: Id97534a2a9fe05bbca614c763c907daea37e9723
This commit is contained in:
Kelly Rossmoyer
2018-10-12 17:38:28 -07:00
parent 8b6ec3fdf7
commit 1000b4e9fa
4 changed files with 43 additions and 0 deletions

View File

@@ -14,6 +14,10 @@
# limitations under the License.
#
PRODUCT_SOONG_NAMESPACES += \
device/google/wahoo \
hardware/google/pixel
ifneq (,$(filter 27, $(PRODUCT_EXTRA_VNDK_VERSIONS)))
_vndk_test := true
endif