Skip to content

Commit

Permalink
dumpsys: fix formatting of service dump times
Browse files Browse the repository at this point in the history
The current formatting of service dump times is
confusing some bugreport parsing tools. This is
because the current service dump time message
is hard to distinguish from the bugreport section
marker.

Adjust the formatting, to make the service
dump time message distinct from the bugreport
section marker.

BUG=30401031
TEST=manual

Manual test
$ adb bugreport /tmp/bugreport.zip
$ cd /tmp
$ mkdir br
$ mv bugreport.zip br
$ cd br
$ grep 'was the duration' bugreport*.txt
------ 4.283s was the duration of 'DUMPSYS MEMINFO' ------
------ 0.053s was the duration of 'DUMPSYS CPUINFO' ------
[...many lines omitted...]
--------- 0.003s was the duration of dumpsys AtCmdFwd
--------- 0.002s was the duration of dumpsys DockObserver
[...many more lines omitted...]

Change-Id: I9d3dd75210b3984240a4b7ab49a1cc6124a269d8
(cherry picked from commit 50b7e03)
  • Loading branch information
gquiche authored and Hector Tellez committed Jul 28, 2016
1 parent 98650f0 commit bca287d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmds/dumpsys/dumpsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ int main(int argc, char* const argv[])
if (N > 1) {
std::chrono::duration<double> elapsed_seconds =
std::chrono::steady_clock::now() - start;
aout << StringPrintf("------ %.3fs was the duration of '", elapsed_seconds.count()).
c_str();
aout << service_name << "' ------" << endl;
aout << StringPrintf("--------- %.3fs ", elapsed_seconds.count()).c_str()
<< "was the duration of dumpsys " << service_name << endl;
}
} else {
aerr << "Can't find service: " << service_name << endl;
Expand Down

0 comments on commit bca287d

Please sign in to comment.