summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKrishna Reddy <vdumpa@nvidia.com>2012-06-05 10:18:13 -0700
committerVarun Wadekar <vwadekar@nvidia.com>2012-07-12 10:12:10 +0530
commit501e19ccae61446ec795d2aced0ebde6c4916c4d (patch)
tree06ae97a2ec7ef1d9e196ef57a6d33f792c08b4d4 /drivers
parent716c50b8ac03eb1fc3e7def1e2e7f53d59722024 (diff)
video: tegra: nvmap: Use trace points in NvMap.
Change-Id: I2a5f0c9305bd53c42df181556d97efa5d6792ad7 Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/106500 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bo Yan <byan@nvidia.com>
Diffstat (limited to 'drivers')
-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 10459becb6a4..049c224458c5 100644
--- a/drivers/video/tegra/nvmap/nvmap_dev.c
+++ b/drivers/video/tegra/nvmap/nvmap_dev.c
@@ -35,12 +35,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"
@@ -762,6 +765,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);
@@ -773,6 +777,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)