Use lshal's new --debug option when emitting bugreports.
This calls into live binderized services and logs their "IBase::debug(...)"
output.
Bug: 36520620
Test: make, adb shell lshal, adb shell bugreport
Change-Id: I421e30e74c82817adf276b5750ce40038852df83
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index f898b90..945d2eb 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -112,6 +112,7 @@
// Must be hardcoded because dumpstate HAL implementation need SELinux access to it
static const std::string kDumpstateBoardPath = "/bugreports/dumpstate_board.txt";
+static const std::string kLsHalDebugPath = "/bugreports/dumpstate_lshal.txt";
static constexpr char PROPERTY_EXTRA_OPTIONS[] = "dumpstate.options";
static constexpr char PROPERTY_LAST_ID[] = "dumpstate.last_id";
@@ -962,7 +963,19 @@
{"ps", "-A", "-T", "-Z", "-O", "pri,nice,rtprio,sched,pcy"});
RunCommand("LIBRANK", {"librank"}, CommandOptions::AS_ROOT);
- RunCommand("HARDWARE HALS", {"lshal"}, CommandOptions::AS_ROOT);
+ if (ds.IsZipping()) {
+ RunCommand(
+ "HARDWARE HALS",
+ {"lshal", std::string("--debug=") + kLsHalDebugPath},
+ CommandOptions::AS_ROOT);
+
+ ds.AddZipEntry("lshal-debug.txt", kLsHalDebugPath);
+
+ unlink(kLsHalDebugPath.c_str());
+ } else {
+ RunCommand(
+ "HARDWARE HALS", {"lshal", "--debug"}, CommandOptions::AS_ROOT);
+ }
RunCommand("PRINTENV", {"printenv"});
RunCommand("NETSTAT", {"netstat", "-nW"});