summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Woody Lin <woodylin@google.com> 2021-05-04 16:37:11 +0800
committer Woody Lin <woodylin@google.com> 2021-05-10 10:35:58 +0000
commitc198f25d4414312f00cd490704f0ab173049e03a (patch)
tree9842ce71cc867619f0a784910ebcd092e6520268
parentf2a516095ecea95a021acc8dd15162aea58648e8 (diff)
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
-rw-r--r--cmds/dumpstate/dumpstate.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index b8df99fd55..501e2814f2 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -1640,6 +1640,10 @@ static Dumpstate::RunStatus dumpstate() {
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)) {