hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/gpu/arm/bifrost/mali_kbase_gpu_memory_debugfs.c
....@@ -48,18 +48,30 @@
4848
4949 kbdev = list_entry(entry, struct kbase_device, entry);
5050 /* output the total memory usage and cap for this device */
51
+ seq_printf(sfile, "<dev> <pages>\n");
5152 seq_printf(sfile, "%-16s %10u\n",
5253 kbdev->devname,
5354 atomic_read(&(kbdev->memdev.used_pages)));
5455 mutex_lock(&kbdev->kctx_list_lock);
56
+ seq_printf(sfile, " <kctx> <comm> <pid> <pages>\n");
5557 list_for_each_entry(kctx, &kbdev->kctx_list, kctx_list_link) {
58
+ struct pid *pid_struct;
59
+ struct task_struct *task;
60
+
61
+ rcu_read_lock();
62
+ pid_struct = find_get_pid(kctx->tgid);
63
+ task = pid_task(pid_struct, PIDTYPE_PID);
5664 /* output the memory usage and cap for each kctx
5765 * opened on this device
5866 */
59
- seq_printf(sfile, " %s-0x%pK %10u\n",
67
+ seq_printf(sfile, " %s-0x%pK %-20s %-10d %10u\n",
6068 "kctx",
6169 kctx,
70
+ task ? task->comm : "[null comm]",
71
+ kctx->tgid,
6272 atomic_read(&(kctx->used_pages)));
73
+ put_pid(pid_struct);
74
+ rcu_read_unlock();
6375 }
6476 mutex_unlock(&kbdev->kctx_list_lock);
6577 }