rk: ion: more debug info
authorCMY <cmy@rock-chips.com>
Wed, 12 Mar 2014 07:21:17 +0000 (15:21 +0800)
committerCMY <cmy@rock-chips.com>
Wed, 12 Mar 2014 07:22:17 +0000 (15:22 +0800)
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/rockchip/rockchip_ion.c

index 1d57e0f302aeb2bd2a5821247a01595a0330ba2e..2f49b3772086b06067edadcffb3da494dd975e1b 100755 (executable)
@@ -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);
index 5cb1cd19f156cf50ae91d9863a74617bab21321b..ae61fb5154de470607904bc9fc85b031ff3f2856 100755 (executable)
@@ -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;