FROMLIST: staging: android: ashmem: add size field in procfs fdinfo

add this information to help user to find ashmem problem.

ashmem leak scenario:
-000|fd = ashmem_create_region
-001|mmap and pagefault
-002|munmap
-003|forget close(fd) <---- which lead to ashmem leak

Link: https://lore.kernel.org/patchwork/patch/1448571
Bug: 191291741
Signed-off-by: liuhailong <liuhailong@oppo.com>
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I68ac5a42357eff11056c9ed1207da07fefbea77d
This commit is contained in:
xieliujie
2021-06-21 18:42:37 +08:00
committed by Suren Baghdasaryan
parent 2f30bf7d8c
commit 143148444d

View File

@@ -894,6 +894,8 @@ static void ashmem_show_fdinfo(struct seq_file *m, struct file *file)
seq_printf(m, "name:\t%s\n",
asma->name + ASHMEM_NAME_PREFIX_LEN);
seq_printf(m, "size:\t%zu\n", asma->size);
mutex_unlock(&ashmem_mutex);
}
#endif