dumpstate: Add "MODULES INFO"
Print .modinfo of each kernel module in section "MODULES INFO". Size of
modinfo for a module is usually 200 ~ 500 bytes. The number of kernel
modules of product with GKI enabled can be 200+, so this could add
extra 100 KB to bugreport in such case.
Bug: 186171455
Test: Take bugreport and check outputs
Change-Id: Ie3d21bc27f9310b741c955f95243936d52d95f1c
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index b8df99f..501e281 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -1640,6 +1640,10 @@
MYLOGD("Skipping 'lsmod' because /proc/modules does not exist\n");
} else {
RunCommand("LSMOD", {"lsmod"});
+ RunCommand("MODULES INFO",
+ {"sh", "-c", "cat /proc/modules | cut -d' ' -f1 | "
+ " while read MOD ; do echo modinfo:$MOD ; modinfo $MOD ; "
+ "done"}, CommandOptions::AS_ROOT);
}
if (android::base::GetBoolProperty("ro.logd.kernel", false)) {