What is meant by "proportional" and "smearing" in batterystats



  • I want to analyze battery consumption of an app and ran:

    > adb shell dumpsys batterystats > dump.txt
    

    Within the filedump I found the section I am interested in:

      Estimated power use (mAh):
        Capacity: 3020, Typical: 3100, Computed drain: 1395, actual drain: 1510-1570
        Screen: 770 Excluded from smearing
        Uid u0a387: 364 ( wake=5.23 radio=0.0425 wifi=4.51 gps=349 sensor=4.88 ) Including smearing: 402 ( proportional=38.6 )
        Cell standby: 128 ( radio=128 ) Excluded from smearing
        Unaccounted: 115 ( ) Including smearing: 0 ( ) Excluded from smearing
        Uid u0a382: 40.6 ( wake=5.00 radio=1.40 wifi=34.2 ) Including smearing: 801 ( screen=684 proportional=76.9 )
        Idle: 27.4 Excluded from smearing
        Uid u0a83: 17.7 ( wake=0.240 radio=0.202 wifi=5.84 gps=2.33 sensor=9.06 ) Including smearing: 19.6 ( proportional=1.88 )
        Wifi: 10.0 ( wifi=10.0 ) Including smearing: 11.1 ( proportional=1.07 )
        ...
    

    Each line contains info on "smearing", and if smearing is included part of this seems to be something called "proportional". These terms are not explained at all in the documentation.



  • Thanks to @Andrew.T for pointing out the https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/proto/android/os/batterystats.proto;l=363;drc=574b4199a111c7d6e370c8e5994050360ba20711 :

    • Smearing: Battery consumption which is shared with other components/processes is spread among apps. IFAIU there are two categories: "screen" and "proportional":
      • Screen: Smeared power from screen usage. Screen usage power is split and smeared among apps, based on activity time.
      • Proportional: Smeared power using proportional method. Power usage from hidden sippers is smeared to all apps proportionally (except for screen usage).

    A " https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/com/android/internal/os/BatteryStatsHelper.java;drc=e6eae18e2c168e2be7c16240ee0ce3ad38c27b1f;l=592 " is a source of battery usage which is one of IDLE, CELL, SCREEN, AMBIENT_DISPLAY, UNACCOUNTED, OVERCOUNTED or if it is a service or system app.

    Proportional is then computed according to the https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/com/android/internal/os/BatteryStatsHelper.java;l=436;drc=e6eae18e2c168e2be7c16240ee0ce3ad38c27b1f :

    proportional power = hidden power * app power ratio

    where "hidden power" is the power usage by hidden components(sippers), app power ratio the estimated power usage of a non-hidden sipper compared to the overall non-hidden sipper power usage.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2