From 69c7dbf15234fe562e613ed62125327d442cfb80 Mon Sep 17 00:00:00 2001 From: CMY Date: Wed, 12 Mar 2014 15:21:17 +0800 Subject: [PATCH] rk: ion: more debug info --- drivers/staging/android/ion/ion.c | 6 ++++-- drivers/staging/android/ion/rockchip/rockchip_ion.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 1d57e0f302ae..2f49b3772086 100755 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -681,14 +681,16 @@ static int ion_debug_client_show_buffer(struct seq_file *s, void *unused) size_t len; seq_printf(s, "----------------------------------------------------\n"); + seq_printf(s, "%16.s: %12.s %8.s %4.s %4.s %4.s\n", "heap_name", "addr", "size", "HC", "IBR", "IHR"); mutex_lock(&client->lock); for (n = rb_first(&client->handles); n; n = rb_next(n)) { struct ion_handle *handle = rb_entry(n, struct ion_handle, node); struct ion_buffer *buffer = handle->buffer; if (buffer->heap->ops->phys) { buffer->heap->ops->phys(buffer->heap, buffer, &addr, &len); - seq_printf(s, "%16.16s: 0x%08lX %8zuKB %d\n", - buffer->heap->name, addr, len>>10, buffer->handle_count); + seq_printf(s, "%16.16s: 0x%08lx %8zuKB %4d %4d %4d\n", + buffer->heap->name, addr, len>>10, buffer->handle_count, + atomic_read(&buffer->ref.refcount), atomic_read(&handle->ref.refcount)); } } mutex_unlock(&client->lock); diff --git a/drivers/staging/android/ion/rockchip/rockchip_ion.c b/drivers/staging/android/ion/rockchip/rockchip_ion.c index 5cb1cd19f156..ae61fb5154de 100755 --- a/drivers/staging/android/ion/rockchip/rockchip_ion.c +++ b/drivers/staging/android/ion/rockchip/rockchip_ion.c @@ -192,7 +192,7 @@ static int ion_cma_heap_debug_show(struct ion_heap *heap, struct seq_file *s, seq_printf(s, "Heap bitmap:\n"); for(i = rows - 1; i>= 0; i--){ - seq_printf(s, "%.4uM@0x%08X: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + seq_printf(s, "%.4uM@0x%08x: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", i+1, base+(i)*SZ_1M, cma->bitmap[i*8 + 7], cma->bitmap[i*8 + 6], @@ -203,7 +203,7 @@ static int ion_cma_heap_debug_show(struct ion_heap *heap, struct seq_file *s, cma->bitmap[i*8 + 1], cma->bitmap[i*8]); } - seq_printf(s, "Heap size: %luM, Heap base: 0x%08X\n", + seq_printf(s, "Heap size: %luM, Heap base: 0x%08x\n", (cma->count)>>8, base); return 0; -- 2.34.1