summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/video/tegra/nvmap/nvmap_dev.c7
-rw-r--r--drivers/video/tegra/nvmap/nvmap_handle.c11
-rw-r--r--drivers/video/tegra/nvmap/nvmap_ioctl.c10
3 files changed, 23 insertions, 5 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c
index 9ecce7eeeb17..aed98f574001 100644
--- a/drivers/video/tegra/nvmap/nvmap_dev.c
+++ b/drivers/video/tegra/nvmap/nvmap_dev.c
@@ -34,12 +34,15 @@
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
+#include <linux/nvmap.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
#include <mach/iovmm.h>
-#include <linux/nvmap.h>
+
+#define CREATE_TRACE_POINTS
+#include <trace/events/nvmap.h>
#include "nvmap.h"
#include "nvmap_ioctl.h"
@@ -761,6 +764,7 @@ static int nvmap_open(struct inode *inode, struct file *filp)
priv = nvmap_create_client(dev, "user");
if (!priv)
return -ENOMEM;
+ trace_nvmap_open(priv);
priv->super = (filp->f_op == &nvmap_super_fops);
@@ -772,6 +776,7 @@ static int nvmap_open(struct inode *inode, struct file *filp)
static int nvmap_release(struct inode *inode, struct file *filp)
{
+ trace_nvmap_release(filp->private_data);
nvmap_client_put(filp->private_data);
return 0;
}
diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c
index 56e2dab1820c..0cdac926f041 100644
--- a/drivers/video/tegra/nvmap/nvmap_handle.c
+++ b/drivers/video/tegra/nvmap/nvmap_handle.c
@@ -30,16 +30,17 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/fs.h>
+#include <linux/shrinker.h>
+#include <linux/moduleparam.h>
+#include <linux/nvmap.h>
#include <asm/cacheflush.h>
#include <asm/outercache.h>
#include <asm/pgtable.h>
#include <mach/iovmm.h>
-#include <linux/nvmap.h>
+#include <trace/events/nvmap.h>
-#include <linux/shrinker.h>
-#include <linux/moduleparam.h>
#include "nvmap.h"
#include "nvmap_mru.h"
#include "nvmap_common.h"
@@ -737,6 +738,7 @@ int nvmap_alloc_handle_id(struct nvmap_client *client,
if (h->alloc)
goto out;
+ trace_nvmap_alloc_handle_id(client, id, heap_mask, align, flags);
h->userflags = flags;
nr_page = ((h->size + PAGE_SIZE - 1) >> PAGE_SHIFT);
h->secure = !!(flags & NVMAP_HANDLE_SECURE);
@@ -819,6 +821,7 @@ void nvmap_free_handle_id(struct nvmap_client *client, unsigned long id)
return;
}
+ trace_nvmap_free_handle_id(client, id);
BUG_ON(!ref->handle);
h = ref->handle;
@@ -919,6 +922,7 @@ struct nvmap_handle_ref *nvmap_create_handle(struct nvmap_client *client,
ref->handle = h;
atomic_set(&ref->pin, 0);
add_handle_ref(client, ref);
+ trace_nvmap_create_handle(client, h, size, ref);
return ref;
}
@@ -992,5 +996,6 @@ struct nvmap_handle_ref *nvmap_duplicate_handle_id(struct nvmap_client *client,
ref->handle = h;
atomic_set(&ref->pin, 0);
add_handle_ref(client, ref);
+ trace_nvmap_duplicate_handle_id(client, id, ref);
return ref;
}
diff --git a/drivers/video/tegra/nvmap/nvmap_ioctl.c b/drivers/video/tegra/nvmap/nvmap_ioctl.c
index 7a10231982c1..44f00d2951a0 100644
--- a/drivers/video/tegra/nvmap/nvmap_ioctl.c
+++ b/drivers/video/tegra/nvmap/nvmap_ioctl.c
@@ -25,13 +25,14 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
+#include <linux/nvmap.h>
#include <asm/cacheflush.h>
#include <asm/outercache.h>
#include <asm/tlbflush.h>
#include <mach/iovmm.h>
-#include <linux/nvmap.h>
+#include <trace/events/nvmap.h>
#include "nvmap_ioctl.h"
#include "nvmap.h"
@@ -83,6 +84,7 @@ int nvmap_ioctl_pinop(struct file *filp, bool is_pin, void __user *arg)
on_stack[0] = (unsigned long)op.handles;
}
+ trace_nvmap_ioctl_pinop(filp->private_data, is_pin, op.count, refs);
if (is_pin)
err = nvmap_pin_ids(filp->private_data, op.count, refs);
else
@@ -234,6 +236,8 @@ int nvmap_map_into_caller_ptr(struct file *filp, void __user *arg)
if (!h)
return -EPERM;
+ trace_nvmap_map_into_caller_ptr(client, h, op.offset,
+ op.length, op.flags);
down_read(&current->mm->mmap_sem);
vma = find_vma(current->mm, op.addr);
@@ -409,6 +413,9 @@ int nvmap_ioctl_rw_handle(struct file *filp, int is_read, void __user* arg)
nvmap_usecount_inc(h);
+ trace_nvmap_ioctl_rw_handle(client, h, is_read, op.offset,
+ op.addr, op.hmem_stride,
+ op.user_stride, op.elem_size, op.count);
copied = rw_handle(client, h, is_read, op.offset,
(unsigned long)op.addr, op.hmem_stride,
op.user_stride, op.elem_size, op.count);
@@ -582,6 +589,7 @@ static int cache_maint(struct nvmap_client *client, struct nvmap_handle *h,
goto out;
}
+ trace_cache_maint(client, h, start, end, op);
wmb();
if (h->flags == NVMAP_HANDLE_UNCACHEABLE ||
h->flags == NVMAP_HANDLE_WRITE_COMBINE || start == end)