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

Commit 7e6edf5c authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add kernel memory allocations to bugreport" into main

parents f408a472 9e332a7f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ cc_binary {
        "main.cpp",
    ],
    required: [
        "alloctop",
        "atrace",
        "bugreport_procdump",
        "dmabuf_dump",
+11 −0
Original line number Diff line number Diff line
@@ -1257,6 +1257,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) {
@@ -1766,6 +1775,8 @@ Dumpstate::RunStatus Dumpstate::dumpstate() {

    DoKmsg();

    DumpKernelMemoryAllocations();

    DumpShutdownCheckpoints();

    DumpIpAddrAndRules();