dumpstate: add key timestamps to power dump

This change adds two key timestamps to the power stats section of
dumpstate_board.txt: the time at which the device was booted and the
current time immediately prior to capturing the power stats.  It also
refactors the lines of code for dumping power stats into a
self-contained function to improve code maintainability.

Currently, because the process of generating a bugreport takes several
minutes, there is significant uncertainty about the temporal
relationship between the bugreport timestamp and the time at which the
power stats were captured.  Also, boot time is reverse-engineered -
again, with an unhelpful degree of uncertainty - by combining the
bugreport timestamp with uptime.  Generating these two timestamps
immediately prior to capturing live power stats will allow
identification of the onset times of key subsystem-related power issues
with much more precision than is currently possible.

Bug: 143312304
Test: Built userdebug and user builds, installed and tested by
generating a bugreport and verifying the new content was present.

Change-Id: I49d3234de27205bdfcfae3662500d2d3b77c2e33
1 file changed
tree: 39f628b29012f985944ad463c8831d7b7553c739
  1. audio/
  2. coral/
  3. dumpstate/
  4. factory-images_coral/
  5. factory-images_flame/
  6. flame/
  7. gpt-utils/
  8. health/
  9. hidl/
  10. json-c/
  11. keymaster/
  12. nfc/
  13. overlay/
  14. pixelstats/
  15. powerstats/
  16. recovery/
  17. seccomp_policy/
  18. self-extractors/
  19. self-extractors_flame/
  20. usb/
  21. vibrator/
  22. voice_processing/
  23. .clang-format
  24. Android.bp
  25. Android.mk
  26. AndroidProducts.mk
  27. aosp_coral.mk
  28. aosp_flame.mk
  29. board-info.txt
  30. BoardConfig-common.mk
  31. CleanSpec.mk
  32. compatibility_matrix.xml
  33. config.fs
  34. default-permissions.xml
  35. device-common.mk
  36. device-coral.mk
  37. device-flame.mk
  38. device.mk
  39. device_framework_matrix.xml
  40. fstab.hardware
  41. fstab.persist
  42. fstab.postinstall
  43. gps.conf
  44. init.hardware.chamber.rc.userdebug
  45. init.hardware.diag.rc.user
  46. init.hardware.diag.rc.userdebug
  47. init.hardware.mpssrfs.rc.user
  48. init.hardware.mpssrfs.rc.userdebug
  49. init.hardware.rc
  50. init.hardware.usb.rc
  51. init.hardware.userdebug.rc.userdebug
  52. init.hardware.wlc.rc.userdebug
  53. init.insmod.coral.cfg
  54. init.insmod.flame.cfg
  55. init.insmod.sh
  56. init.logging.rc
  57. init.mdm.sh
  58. init.msm.usb.configfs.rc
  59. init.power.rc
  60. init.qcom.modem_links.sh
  61. init.qcom.usb.rc
  62. init.qcom.usb.sh
  63. init.qti.getbootdevice.sh
  64. init.qti.qseecomd.sh
  65. init.radio.sh
  66. init.ramoops.sh
  67. init.recovery.device.rc
  68. init.sensors.sh
  69. manifest.xml
  70. media_codecs.xml
  71. media_codecs_omx.xml
  72. media_codecs_performance.xml
  73. media_codecs_vendor_audio.xml
  74. media_profiles.xml
  75. media_profiles_V1_0.xml
  76. OWNERS
  77. p2p_supplicant_overlay.conf
  78. powerhint.json
  79. product.prop
  80. recovery.wipe
  81. sec_config
  82. sensors.hals.conf
  83. thermal-engine-coral-normal_mode.conf
  84. thermal-engine-coral-retail_mode.conf
  85. thermal-engine-flame-normal_mode.conf
  86. thermal-engine-flame-retail_mode.conf
  87. thermal_info_config_coral.json
  88. thermal_info_config_coral_jaws.json
  89. thermal_info_config_flame.json
  90. thermal_info_config_flame_jaws.json
  91. ueventd.rc
  92. utils.mk
  93. WCNSS_qcom_cfg.ini
  94. wifi_concurrency_cfg.txt
  95. wpa_supplicant_overlay.conf
  96. wpa_supplicant_wcn.conf