diff options
author | 2019-03-12 03:38:53 -0700 | |
---|---|---|
committer | 2019-03-12 03:38:53 -0700 | |
commit | bea86c66cf2758a43807b94dbe9c8d02ab90cdfd (patch) | |
tree | ccb44039e0524c59cbc638ae424b75aa04972015 | |
parent | 0ad4e5df845299b7ac966bfe434327bc22b8fdc1 (diff) | |
parent | 432ff435a0dec8ab587bfb2da214f0b0733bcf4d (diff) |
Merge "Dumpstate: Refactor DumpHals" am: b0f2b48c0a
am: 432ff435a0
Change-Id: I6e1e552abbdcdd732ab4a0dfea4b0b3d0ea1d152
-rw-r--r-- | cmds/dumpstate/dumpstate.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index 5b4317224a..51b230748e 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -1186,6 +1186,15 @@ static void RunDumpsysNormal() { } static void DumpHals() { + if (!ds.IsZipping()) { + RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z", "--debug"}, + CommandOptions::WithTimeout(10).AsRootIfAvailable().Build()); + return; + } + DurationReporter duration_reporter("DUMP HALS"); + RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z"}, + CommandOptions::WithTimeout(2).AsRootIfAvailable().Build()); + using android::hidl::manager::V1_0::IServiceManager; using android::hardware::defaultServiceManager; @@ -1262,14 +1271,7 @@ static void dumpstate() { {"ps", "-A", "-T", "-Z", "-O", "pri,nice,rtprio,sched,pcy,time"}); RunCommand("LIBRANK", {"librank"}, CommandOptions::AS_ROOT); - if (ds.IsZipping()) { - RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z"}, - CommandOptions::WithTimeout(2).AsRootIfAvailable().Build()); - DumpHals(); - } else { - RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z", "--debug"}, - CommandOptions::WithTimeout(10).AsRootIfAvailable().Build()); - } + DumpHals(); RunCommand("PRINTENV", {"printenv"}); RunCommand("NETSTAT", {"netstat", "-nW"}); @@ -1569,14 +1571,7 @@ static void DumpstateWifiOnly() { RunDumpsys("DUMPSYS", {"wifi"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); - if (ds.IsZipping()) { - RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z"}, - CommandOptions::WithTimeout(2).AsRootIfAvailable().Build()); - DumpHals(); - } else { - RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z", "--debug"}, - CommandOptions::WithTimeout(10).AsRootIfAvailable().Build()); - } + DumpHals(); printf("========================================================\n"); printf("== dumpstate: done (id %d)\n", ds.id_); |