Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c198f25d authored by Woody Lin's avatar Woody Lin
Browse files

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
parent f2a51609
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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)) {