gpu: ion: Refactor debugfs printing

Printing to debugfs is done from a centralized location for
all the heaps managed by ion. This architecture is not
sustainable in the long run since different heaps have different
requirements for what should be printed.

Refactor the debugfs printing for ion so that each heap is
responsible for printing its information.

Change-Id: I1dbe13432a4ab07f27ea4756c3be7fa01ad1df92
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
This commit is contained in:
Olav Haugan
2012-01-13 11:42:15 -08:00
committed by Stephen Boyd
parent 0a0df35f5b
commit 46533157db
5 changed files with 48 additions and 117 deletions

View File

@@ -1493,30 +1493,8 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
client->pid, size);
}
}
if (heap->ops->get_allocated) {
seq_printf(s, "total bytes currently allocated: %lx\n",
heap->ops->get_allocated(heap));
}
if (heap->ops->get_total) {
seq_printf(s, "total heap size: %lx\n",
heap->ops->get_total(heap));
}
if (heap->ops->get_alloc_cnt) {
seq_printf(s, "allocation count: %lx\n",
heap->ops->get_alloc_cnt(heap));
}
if (heap->ops->get_umap_cnt) {
seq_printf(s, "umapping count: %lx\n",
heap->ops->get_umap_cnt(heap));
}
if (heap->ops->get_kmap_cnt) {
seq_printf(s, "kmapping count: %lx\n",
heap->ops->get_kmap_cnt(heap));
}
if (heap->ops->get_secured) {
seq_printf(s, "secured heap: %s\n",
heap->ops->get_secured(heap) ? "Yes" : "No");
}
if (heap->ops->print_debug)
heap->ops->print_debug(heap, s);
return 0;
}