diff options
author | Donghan Ryu <dryu@nvidia.com> | 2011-04-11 20:18:49 +0900 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-04-14 21:23:32 -0700 |
commit | 7cd09b6a4a9bc23f5a5aa0ec2f67b70b7c9a2a4a (patch) | |
tree | fd338cdf1e9f558240c3657135e0fc96bfbe4e7b /drivers | |
parent | 0c7714c9efe4d017bc73ebc2b2c119bb8a342735 (diff) |
video: tegra: nvmap: debugfs improvement
nvmap's debugfs had a bad format so it was
very difficult to read the outputs. this commit
fixes it and added total allocation size along
with it
Bug 813891
Change-Id: I6e3165b3ff917d9510d39f1e35b8e6b59c086592
Reviewed-on: http://git-master/r/27349
Reviewed-by: Donghan Ryu <dryu@nvidia.com>
Tested-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_dev.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c index 5d63dbc4fbc9..0e988edc005b 100644 --- a/drivers/video/tegra/nvmap/nvmap_dev.c +++ b/drivers/video/tegra/nvmap/nvmap_dev.c @@ -962,11 +962,11 @@ static void client_stringify(struct nvmap_client *client, struct seq_file *s) { char task_comm[TASK_COMM_LEN]; if (!client->task) { - seq_printf(s, "%8s %16s %8u", client->name, "kernel", 0); + seq_printf(s, "%-16s %16s %8u", client->name, "kernel", 0); return; } get_task_comm(task_comm, client->task); - seq_printf(s, "%8s %16s %8u", client->name, task_comm, + seq_printf(s, "%-16s %16s %8u", client->name, task_comm, client->task->pid); } @@ -974,19 +974,17 @@ static void allocations_stringify(struct nvmap_client *client, struct seq_file *s) { struct rb_node *n = rb_first(&client->handle_refs); - unsigned long long total = 0; for (; n != NULL; n = rb_next(n)) { struct nvmap_handle_ref *ref = rb_entry(n, struct nvmap_handle_ref, node); struct nvmap_handle *handle = ref->handle; if (handle->alloc && !handle->heap_pgalloc) { - seq_printf(s, " %8u@%8lx ", handle->size, - handle->carveout->base); - total += handle->size; + seq_printf(s, "%-16s %-16s %8lx %10u\n", "", "", + handle->carveout->base, + handle->size); } } - seq_printf(s, " total: %llu\n", total); } static int nvmap_debug_allocations_show(struct seq_file *s, void *unused) @@ -994,14 +992,19 @@ static int nvmap_debug_allocations_show(struct seq_file *s, void *unused) struct nvmap_carveout_node *node = s->private; struct nvmap_carveout_commit *commit; unsigned long flags; + unsigned int total = 0; spin_lock_irqsave(&node->clients_lock, flags); list_for_each_entry(commit, &node->clients, list) { struct nvmap_client *client = get_client_from_carveout_commit(node, commit); client_stringify(client, s); + seq_printf(s, " %10u\n", commit->commit); allocations_stringify(client, s); + seq_printf(s, "\n"); + total += commit->commit; } + seq_printf(s, "%-16s %-16s %8u %10u\n", "total", "", 0, total); spin_unlock_irqrestore(&node->clients_lock, flags); return 0; @@ -1025,14 +1028,17 @@ static int nvmap_debug_clients_show(struct seq_file *s, void *unused) struct nvmap_carveout_node *node = s->private; struct nvmap_carveout_commit *commit; unsigned long flags; + unsigned int total = 0; spin_lock_irqsave(&node->clients_lock, flags); list_for_each_entry(commit, &node->clients, list) { struct nvmap_client *client = get_client_from_carveout_commit(node, commit); client_stringify(client, s); - seq_printf(s, " %8u\n", commit->commit); + seq_printf(s, " %10u\n", commit->commit); + total += commit->commit; } + seq_printf(s, "%-16s %-16s %8u %10u\n", "total", "", 0, total); spin_unlock_irqrestore(&node->clients_lock, flags); return 0; |