From bca287d28450d4cc23382174c86de3c84e6a0b8f Mon Sep 17 00:00:00 2001 From: mukesh agrawal Date: Wed, 27 Jul 2016 12:01:49 -0700 Subject: [PATCH] dumpsys: fix formatting of service dump times 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 50b7e039500b3decc78d5ffff9919d1481df4964) --- cmds/dumpsys/dumpsys.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp index 957a44912c..d19e98a10e 100644 --- a/cmds/dumpsys/dumpsys.cpp +++ b/cmds/dumpsys/dumpsys.cpp @@ -274,9 +274,8 @@ int main(int argc, char* const argv[]) if (N > 1) { std::chrono::duration 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; -- 2.11.0