diff options
author | Devin Moore <devinmoore@google.com> | 2022-06-10 01:01:31 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-06-10 01:01:31 +0000 |
commit | f7a9d3a95f736e3edbb25324d89e9b4ab7d5e77c (patch) | |
tree | 1afb9c4c3cf3abcd79b6a3756b174bf5fa985c73 | |
parent | 66d083b88f69b8381944a172445e3ecd364d3718 (diff) | |
parent | c37c25ca26e6014edd5654903adfc8a1888bafc1 (diff) | |
download | native-f7a9d3a95f736e3edbb25324d89e9b4ab7d5e77c.tar.gz |
Merge "Add VINTF files to bug reports" am: c37c25ca26
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2120696
Change-Id: Ic062cf09a12e0a32b24dec3e5e203d38c8c786d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | cmds/dumpstate/Android.bp | 1 | ||||
-rw-r--r-- | cmds/dumpstate/dumpstate.cpp | 20 |
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"); |