diff options
| author | 2019-03-12 03:43:04 -0700 | |
|---|---|---|
| committer | 2019-03-12 03:43:04 -0700 | |
| commit | 01b6b4d63060ac2d10540fd42171a36528f11c38 (patch) | |
| tree | 097ddca28156c529f880f1490a8ab6ac15a5b3fb | |
| parent | ac653fe0e3e00672e3c8d2e9e2147083adb58002 (diff) | |
| parent | bea86c66cf2758a43807b94dbe9c8d02ab90cdfd (diff) | |
Merge "Dumpstate: Refactor DumpHals" am: b0f2b48c0a am: 432ff435a0
am: bea86c66cf
Change-Id: I105a1a783d9fc8ab5a7a79df836942ee300f07f5
| -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 ea266e5f75..0cf2df069c 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"}); @@ -1575,14 +1577,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_); |