From a0ea4a2e66572007b61173d1f6a074e9857c1476 Mon Sep 17 00:00:00 2001 From: binqi zhang Date: Tue, 19 Nov 2019 21:08:10 +0800 Subject: [PATCH] memtrack: add EGL cached mem counting on AndroidP [3/3] PD#SWPL-16844 Problem: Lost ram caused by ion_page_pool_alloc Solution: count ion cached memory in other mtrack Verify: adb shell dumpsys meminfo Confirm EGL entries Change-Id: I43c1e7fdf9313db08e72d0ff77e4a6215d77cceb Signed-off-by: binqi zhang --- drivers/staging/android/ion/ion_system_heap.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index 86fd2fce0a2f..61d70ae08e26 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -272,6 +272,9 @@ static int ion_system_heap_debug_show(struct ion_heap *heap, struct seq_file *s, struct ion_system_heap, heap); int i; +#ifdef CONFIG_AMLOGIC_MODIFY + unsigned int total_cached = 0; +#endif struct ion_page_pool *pool; for (i = 0; i < NUM_ORDERS; i++) { @@ -280,9 +283,16 @@ static int ion_system_heap_debug_show(struct ion_heap *heap, struct seq_file *s, seq_printf(s, "%d order %u highmem pages uncached %lu total\n", pool->high_count, pool->order, (PAGE_SIZE << pool->order) * pool->high_count); +#ifdef CONFIG_AMLOGIC_MODIFY + total_cached += (PAGE_SIZE << pool->order) * pool->high_count; +#endif seq_printf(s, "%d order %u lowmem pages uncached %lu total\n", pool->low_count, pool->order, (PAGE_SIZE << pool->order) * pool->low_count); +#ifdef CONFIG_AMLOGIC_MODIFY + total_cached += (PAGE_SIZE << pool->order) * pool->low_count; +#endif + } for (i = 0; i < NUM_ORDERS; i++) { @@ -291,10 +301,20 @@ static int ion_system_heap_debug_show(struct ion_heap *heap, struct seq_file *s, seq_printf(s, "%d order %u highmem pages cached %lu total\n", pool->high_count, pool->order, (PAGE_SIZE << pool->order) * pool->high_count); +#ifdef CONFIG_AMLOGIC_MODIFY + total_cached += (PAGE_SIZE << pool->order) * pool->high_count; +#endif seq_printf(s, "%d order %u lowmem pages cached %lu total\n", pool->low_count, pool->order, (PAGE_SIZE << pool->order) * pool->low_count); +#ifdef CONFIG_AMLOGIC_MODIFY + total_cached += (PAGE_SIZE << pool->order) * pool->low_count; +#endif } +#ifdef CONFIG_AMLOGIC_MODIFY + seq_puts(s, "----------------------------------------------------\n"); + seq_printf(s, "%16s %16u\n", "total cached", total_cached); +#endif return 0; }