Add total DMA-BUF heap pool size information to dumpsys meminfo

Some DMA-BUF heaps maintain pools of pre-zeroed memory for faster
allocations. Print the total size of all DMA-BUF heap pools as part of
dumpsys meminfo and use the same in LostRam calculation.

Test: dumpsys meminfo
Bug: 167709539
Change-Id: Ifb61fe596c1a8fab1bd536ec904285e532629b71
Merged-In: Ifb61fe596c1a8fab1bd536ec904285e532629b71
This commit is contained in:
Hridya Valsaraju
2021-02-04 15:55:02 -08:00
parent 363d44d7a0
commit 365ffff4b5
3 changed files with 42 additions and 2 deletions

View File

@@ -2566,6 +2566,14 @@ public final class Debug
*/
public static native long getIonHeapsSizeKb();
/**
* Return memory size in kilobytes allocated for DMA-BUF heap pools or -1 if
* /sys/kernel/dma_heap/total_pools_kb could not be read.
*
* @hide
*/
public static native long getDmabufHeapPoolsSizeKb();
/**
* Return memory size in kilobytes allocated for ION pools or -1 if
* /sys/kernel/ion/total_pools_kb could not be read.