Add dumpsys finish timestamp

Dumpsys are very helpful to debug issues.
Nevertheless a recurrent problem is that the dumpsys take time especially
if multiple are taken like during a bug report generation.
Due to this delay, it can be hard to understand during
which logs a dumpsys was taken.

This commit changes the last line of a dumpsys to contain the time it
was generated.
Here is an example:

[... normal dumpsys...]
    - Mix ID 8 I/O handle 37
  - 1 sinks:
    - Device ID 7 AUDIO_DEVICE_OUT_TELEPHONY_TX
Audio Policy Mix:
--------- 0.036s was the duration of dumpsys media.audio_policy, ending at: 2017-08-14 20:35:43

This patch adds the last part:
*, ending at: 2017-08-14 20:35:43*

Bug: 64699427
Test: adb bugreport
Test:  mmm -j32 frameworks/native/cmds/dumpsys && adb sync data && adb shell /data/nativetest/dumpsys_test/dumpsys_test --gtest_filter=-DumpsysTest.DumpRunningServiceTimeout
       # DumpRunningServiceTimeout is broken independently of this patch
Change-Id: I9873e7dd915b4f7cdd6eac5c44487ae5740fa805
Signed-off-by: Kevin Rocard <krocard@google.com>
1 file changed