summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Moore <devinmoore@google.com>2022-06-08 22:47:02 +0000
committerDevin Moore <devinmoore@google.com>2022-06-08 22:47:02 +0000
commit8df81bb3d4e44fa1c82601429657ec4ccd45a9ad (patch)
tree4f63e3bcd02fda8863e390ac12575f2c5c521534
parent7514e3b91a168996e006b3b69e2e6c51ef50a345 (diff)
downloadnative-8df81bb3d4e44fa1c82601429657ec4ccd45a9ad.tar.gz
Add VINTF files to bug reports
Multiple files make up the vendor interface that is created at run-time. These files can helpful for debugging issues like b/200606478. Test: adb shell am bug-report Bug: 202792567 Change-Id: I1871e03c4ec166e85c47d670be08d7f57fc36c12
-rw-r--r--cmds/dumpstate/Android.bp1
-rw-r--r--cmds/dumpstate/dumpstate.cpp20
2 files changed, 21 insertions, 0 deletions
diff --git a/cmds/dumpstate/Android.bp b/cmds/dumpstate/Android.bp
index a2491e503f..a60972b722 100644
--- a/cmds/dumpstate/Android.bp
+++ b/cmds/dumpstate/Android.bp
@@ -101,6 +101,7 @@ cc_defaults {
"libhidlbase",
"liblog",
"libutils",
+ "libvintf",
"libbinderdebug",
"packagemanager_aidl-cpp",
],
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index 0dab0e472e..f0b2b286cf 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -88,6 +88,7 @@
#include <private/android_logger.h>
#include <serviceutils/PriorityDumper.h>
#include <utils/StrongPointer.h>
+#include <vintf/VintfObject.h>
#include "DumpstateInternal.h"
#include "DumpstateService.h"
#include "dumpstate.h"
@@ -1396,6 +1397,23 @@ static void DumpHals(int out_fd = STDOUT_FILENO) {
}
}
+// Dump all of the files that make up the vendor interface.
+// See the files listed in dumpFileList() for the latest list of files.
+static void DumpVintf() {
+ const auto vintfFiles = android::vintf::details::dumpFileList();
+ for (const auto vintfFile : vintfFiles) {
+ struct stat st;
+ if (stat(vintfFile.c_str(), &st) == 0) {
+ if (S_ISDIR(st.st_mode)) {
+ ds.AddDir(vintfFile, true /* recursive */);
+ } else {
+ ds.EnqueueAddZipEntryAndCleanupIfNeeded(ZIP_ROOT_DIR + vintfFile,
+ vintfFile);
+ }
+ }
+ }
+}
+
static void DumpExternalFragmentationInfo() {
struct stat st;
if (stat("/proc/buddyinfo", &st) != 0) {
@@ -1621,6 +1639,8 @@ static Dumpstate::RunStatus dumpstate() {
do_dmesg();
}
+ DumpVintf();
+
RunCommand("LIST OF OPEN FILES", {"lsof"}, CommandOptions::AS_ROOT);
RUN_SLOW_FUNCTION_WITH_CONSENT_CHECK(for_each_pid, do_showmap, "SMAPS OF ALL PROCESSES");