memtrack: fix wrong GL mem counting on AndroidP [2/3]
authorbinqi zhang <binqi.zhang@amlogic.com>
Wed, 20 Nov 2019 10:24:34 +0000 (18:24 +0800)
committerBinqi Zhang <binqi.zhang@amlogic.com>
Wed, 4 Dec 2019 03:09:28 +0000 (20:09 -0700)
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: Ie9e5535089260ffb89568ec66774af25a3f694ec
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
bifrost/r16p0/kernel/drivers/gpu/arm/midgard/mali_kbase_gpu_memory_debugfs.c [changed mode: 0755->0644]
dvalin/kernel/drivers/gpu/arm/midgard/mali_kbase_gpu_memory_debugfs.c

old mode 100755 (executable)
new mode 100644 (file)
index 514b065..d96f286
@@ -47,16 +47,21 @@ static int kbasep_gpu_memory_seq_show(struct seq_file *sfile, void *data)
 
                kbdev = list_entry(entry, struct kbase_device, entry);
                /* output the total memory usage and cap for this device */
-               seq_printf(sfile, "%-16s  %10u\n",
+               seq_printf(sfile, "%-16s %-16s %10u\n",
                                kbdev->devname,
+                               "total used_pages",
                                atomic_read(&(kbdev->memdev.used_pages)));
+               seq_puts(sfile, "----------------------------------------------------\n");
+               seq_printf(sfile, "%-16s %-16s %-16s\n",
+                               "kctx", "pid", "used_pages");
+               seq_puts(sfile, "----------------------------------------------------\n");
                mutex_lock(&kbdev->kctx_list_lock);
                list_for_each_entry(element, &kbdev->kctx_list, link) {
                        /* output the memory usage and cap for each kctx
                        * opened on this device */
-                       seq_printf(sfile, "  %s-0x%p %10u\n",
-                               "kctx",
+                       seq_printf(sfile, "%p %10u %10u\n",
                                element->kctx,
+                               element->kctx->tgid,
                                atomic_read(&(element->kctx->used_pages)));
                }
                mutex_unlock(&kbdev->kctx_list_lock);
index 2c42f5ccdd4e9ff97d6d88209c51fb8627f8082e..70fdbf15013a4c2e7c11dc0e52331be4b5a8a3f8 100644 (file)
@@ -47,20 +47,26 @@ static int kbasep_gpu_memory_seq_show(struct seq_file *sfile, void *data)
 
                kbdev = list_entry(entry, struct kbase_device, entry);
                /* output the total memory usage and cap for this device */
-               seq_printf(sfile, "%-16s  %10u\n",
+               seq_printf(sfile, "%-16s %-16s %10u\n",
                                kbdev->devname,
+                               "total used_pages",
                                atomic_read(&(kbdev->memdev.used_pages)));
+               seq_puts(sfile, "----------------------------------------------------\n");
+               seq_printf(sfile, "%-16s %-16s %-16s\n",
+                               "kctx", "pid", "used_pages");
+               seq_puts(sfile, "----------------------------------------------------\n");
                mutex_lock(&kbdev->kctx_list_lock);
                list_for_each_entry(kctx, &kbdev->kctx_list, kctx_list_link) {
                        /* output the memory usage and cap for each kctx
                        * opened on this device */
-                       seq_printf(sfile, "  %s-0x%p %10u\n",
-                               "kctx",
+                       seq_printf(sfile, "%p %10u %10u\n",
                                kctx,
+                               kctx->tgid,
                                atomic_read(&(kctx->used_pages)));
                }
                mutex_unlock(&kbdev->kctx_list_lock);
        }
+
        kbase_dev_list_put(kbdev_list);
        return 0;
 }