]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blobdiff - drivers/video/tegra/nvmap/nvmap_dev.c
video: tegra: nvmap: add handle share count to debug stats
[sojka/nv-tegra/linux-3.10.git] / drivers / video / tegra / nvmap / nvmap_dev.c
index d3e1230a0022d32bd38514f9618ce4ab7ae44908..3e4f50671cdaba4b487f40bf6a359835368e9c17 100644 (file)
@@ -448,6 +448,7 @@ static void destroy_client(struct nvmap_client *client)
 
                dma_buf_put(ref->handle->dmabuf);
                rb_erase(&ref->node, &client->handle_refs);
+               atomic_dec(&ref->handle->share_count);
 
                dupes = atomic_read(&ref->dupes);
                while (dupes--)
@@ -828,7 +829,7 @@ static void allocations_stringify(struct nvmap_client *client,
                        phys_addr_t base = iovmm ? 0 :
                                           (handle->carveout->base);
                        seq_printf(s,
-                               "%-18s %-18s %8llx %10zuK %8x %6u %6u %6u %6u %6u %8p\n",
+                               "%-18s %-18s %8llx %10zuK %8x %6u %6u %6u %6u %6u %6u %8p\n",
                                "", "",
                                (unsigned long long)base, K(handle->size),
                                handle->userflags,
@@ -837,6 +838,7 @@ static void allocations_stringify(struct nvmap_client *client,
                                atomic_read(&ref->pin),
                                atomic_read(&handle->kmap_count),
                                atomic_read(&handle->umap_count),
+                               atomic_read(&handle->share_count),
                                handle);
                }
        }
@@ -852,9 +854,9 @@ static int nvmap_debug_allocations_show(struct seq_file *s, void *unused)
        spin_lock(&node->clients_lock);
        seq_printf(s, "%-18s %18s %8s %11s\n",
                "CLIENT", "PROCESS", "PID", "SIZE");
-       seq_printf(s, "%-18s %18s %8s %11s %8s %6s %6s %6s %6s %6s %8s\n",
+       seq_printf(s, "%-18s %18s %8s %11s %8s %6s %6s %6s %6s %6s %6s %8s\n",
                        "", "", "BASE", "SIZE", "FLAGS", "REFS",
-                       "DUPES", "PINS", "KMAPS", "UMAPS", "UID");
+                       "DUPES", "PINS", "KMAPS", "UMAPS", "SHARE", "UID");
        list_for_each_entry(commit, &node->clients, list) {
                struct nvmap_client *client =
                        get_client_from_carveout_commit(node, commit);
@@ -973,9 +975,9 @@ static int nvmap_debug_iovmm_allocations_show(struct seq_file *s, void *unused)
        spin_lock(&dev->clients_lock);
        seq_printf(s, "%-18s %18s %8s %11s\n",
                "CLIENT", "PROCESS", "PID", "SIZE");
-       seq_printf(s, "%-18s %18s %8s %11s %8s %6s %6s %6s %6s %6s %8s\n",
+       seq_printf(s, "%-18s %18s %8s %11s %8s %6s %6s %6s %6s %6s %6s %8s\n",
                        "", "", "BASE", "SIZE", "FLAGS", "REFS",
-                       "DUPES", "PINS", "KMAPS", "UMAPS", "UID");
+                       "DUPES", "PINS", "KMAPS", "UMAPS", "SHARE", "UID");
        list_for_each_entry(client, &dev->clients, list) {
                int iovm_commit = atomic_read(&client->iovm_commit);
                client_stringify(client, s);