video: tegra: host: Add syncpt trace events
Terje Bergstrom [Mon, 14 May 2012 10:28:49 +0000 (15:28 +0530)]
Add trace events for updating the syncpt value from hardware, and
wait check.

Change-Id: If17de153ae36c0665fe0af2f405dfe42f7fcd656
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/101524
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>

Conflicts:

drivers/video/tegra/host/nvhost_syncpt.c

drivers/video/tegra/host/host1x/host1x_syncpt.c
drivers/video/tegra/host/nvhost_syncpt.c
include/trace/events/nvhost.h

index d0de494..967bc6f 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <linux/nvhost_ioctl.h>
 #include <linux/io.h>
+#include <trace/events/nvhost.h>
 #include "nvhost_syncpt.h"
 #include "nvhost_acm.h"
 #include "dev.h"
@@ -124,6 +125,8 @@ static int t20_syncpt_wait_check(struct nvhost_syncpt *sp,
                u32 override;
 
                BUG_ON(wait->syncpt_id >= NV_HOST1X_SYNCPT_NB_PTS);
+               trace_nvhost_syncpt_wait_check(wait->mem, wait->offset,
+                               wait->syncpt_id, wait->thresh);
                if (nvhost_syncpt_is_expired(sp,
                                        wait->syncpt_id, wait->thresh)) {
                        /*
index cba6f44..b245788 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/stat.h>
+#include <trace/events/nvhost.h>
 #include "nvhost_syncpt.h"
 #include "nvhost_acm.h"
 #include "dev.h"
@@ -71,9 +72,14 @@ void nvhost_syncpt_save(struct nvhost_syncpt *sp)
  */
 u32 nvhost_syncpt_update_min(struct nvhost_syncpt *sp, u32 id)
 {
+       u32 val;
+
        BUG_ON(!syncpt_op(sp).update_min);
 
-       return syncpt_op(sp).update_min(sp, id);
+       val = syncpt_op(sp).update_min(sp, id);
+       trace_nvhost_syncpt_update_min(id, val);
+
+       return val;
 }
 
 /**
index ad18853..4bb79e3 100644 (file)
@@ -453,6 +453,48 @@ TRACE_EVENT(nvhost_wait_cdma,
        TP_printk("name=%s, event=%d", __entry->name, __entry->eventid)
 );
 
+TRACE_EVENT(nvhost_syncpt_update_min,
+       TP_PROTO(u32 id, u32 val),
+
+       TP_ARGS(id, val),
+
+       TP_STRUCT__entry(
+               __field(u32, id)
+               __field(u32, val)
+       ),
+
+       TP_fast_assign(
+               __entry->id = id;
+               __entry->val = val;
+       ),
+
+       TP_printk("id=%d, val=%d", __entry->id, __entry->val)
+);
+
+TRACE_EVENT(nvhost_syncpt_wait_check,
+       TP_PROTO(u32 mem_id, u32 offset, u32 syncpt_id, u32 val),
+
+       TP_ARGS(mem_id, offset, syncpt_id, val),
+
+       TP_STRUCT__entry(
+               __field(u32, mem_id)
+               __field(u32, offset)
+               __field(u32, syncpt_id)
+               __field(u32, val)
+       ),
+
+       TP_fast_assign(
+               __entry->mem_id = mem_id;
+               __entry->offset = offset;
+               __entry->syncpt_id = syncpt_id;
+               __entry->val = val;
+       ),
+
+       TP_printk("mem_id=%08x, offset=%05x, id=%d, val=%d",
+               __entry->mem_id, __entry->offset,
+               __entry->syncpt_id, __entry->val)
+);
+
 #endif /*  _TRACE_NVHOST_H */
 
 /* This part must be outside protection */