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

Commit 54410264 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add kernel memory allocations to bugreport" into main am: 7e6edf5c am: ef538844

parents 77d30b04 ef538844
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ cc_binary {
        "main.cpp",
    ],
    required: [
        "alloctop",
        "atrace",
        "bugreport_procdump",
        "default_screenshot",
+11 −0
Original line number Diff line number Diff line
@@ -1264,6 +1264,15 @@ static void DumpIpAddrAndRules() {
    RunCommand("IP RULES v6", {"ip", "-6", "rule", "show"});
}

static void DumpKernelMemoryAllocations() {
    if (!access("/proc/allocinfo", F_OK)) {
        // Print the top 100 biggest memory allocations of at least one byte.
        // The output is sorted by size, descending.
        RunCommand("KERNEL MEMORY ALLOCATIONS",
                   {"alloctop", "--once", "--sort", "s", "--min", "1", "--lines", "100"});
    }
}

static Dumpstate::RunStatus RunDumpsysTextByPriority(const std::string& title, int priority,
                                                     std::chrono::milliseconds timeout,
                                                     std::chrono::milliseconds service_timeout) {
@@ -1773,6 +1782,8 @@ Dumpstate::RunStatus Dumpstate::dumpstate() {

    DoKmsg();

    DumpKernelMemoryAllocations();

    DumpShutdownCheckpoints();

    DumpIpAddrAndRules();