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

Commit 1da80c50 authored by Hridya Valsaraju's avatar Hridya Valsaraju
Browse files

dumpstate: print DMA-BUF sysfs stats in bugreport

Dump DMA-BUF per-buffer/per-exporter/per-device stats in bugreport.

These statistics will be helpful to analyze memory-related issues like Low
Memory Kills and ANR events.

Measured over 5 cycles, the addition of the statistics appear to
approximately increase the size of bugreport.zip by 26KB.

Bug: 167709539
Test: adb shell am bug-report
Change-Id: I2aceef79c4ec97ad400cb250c0075004fe50cdc6
parent 048f1e93
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ cc_binary {
    ],
    required: [
        "atrace",
        "dmabuf_dump",
        "ip",
        "iptables",
        "librank",
+2 −4
Original line number Diff line number Diff line
@@ -1823,10 +1823,8 @@ Dumpstate::RunStatus Dumpstate::DumpstateDefaultAfterCritical() {
    RunCommand("IOTOP", {"iotop", "-n", "1", "-m", "100"});

    // Gather shared memory buffer info if the product implements it
    struct stat st;
    if (!stat("/product/bin/dmabuf_dump", &st)) {
        RunCommand("Dmabuf dump", {"/product/bin/dmabuf_dump"});
    }
    RunCommand("Dmabuf dump", {"dmabuf_dump"});
    RunCommand("Dmabuf per-buffer/per-exporter/per-device stats", {"dmabuf_dump", "-b"});

    DumpFile("PSI cpu", "/proc/pressure/cpu");
    DumpFile("PSI memory", "/proc/pressure/memory");