video: tegra: host: Add trace events for ACM
Terje Bergstrom [Fri, 14 Sep 2012 08:23:13 +0000 (11:23 +0300)]
Add trace events to log when ACM changes the clock rate of a unit.

Bug 1046244

Change-Id: Ifcc643b41c95e06ae046414f6db201e286ecd913
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/132570
Reviewed-by: Automatic_Commit_Validation_User

drivers/video/tegra/host/nvhost_acm.c
include/trace/events/nvhost.h

index ea6c679..0e787f8 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/device.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
+#include <trace/events/nvhost.h>
 
 #include <mach/powergate.h>
 #include <mach/clk.h>
@@ -316,6 +317,9 @@ static int nvhost_module_update_rate(struct nvhost_device *dev, int index)
        if (!rate)
                rate = default_rate;
 
+       trace_nvhost_module_update_rate(dev->name,
+                       dev->clocks[index].name, rate);
+
        return clk_set_rate(dev->clk[index], rate);
 }
 
@@ -475,6 +479,8 @@ int nvhost_module_set_devfreq_rate(struct nvhost_device *dev, int index,
        rate = clk_round_rate(dev->clk[index], rate);
        dev->clocks[index].devfreq_rate = rate;
 
+       trace_nvhost_module_set_devfreq_rate(dev->name,
+                       dev->clocks[index].name, rate);
        return nvhost_module_update_rate(dev, index);
 }
 
index 6506af4..7c94cb4 100644 (file)
@@ -562,6 +562,52 @@ TRACE_EVENT(nvhost_syncpt_wait_check,
                __entry->min)
 );
 
+TRACE_EVENT(nvhost_module_set_devfreq_rate,
+       TP_PROTO(const char *devname, const char *clockname,
+               unsigned long rate),
+
+       TP_ARGS(devname, clockname, rate),
+
+       TP_STRUCT__entry(
+               __field(const char *, devname)
+               __field(const char *, clockname)
+               __field(unsigned long, rate)
+       ),
+
+       TP_fast_assign(
+               __entry->devname = devname;
+               __entry->clockname = clockname;
+               __entry->rate = rate;
+       ),
+
+       TP_printk("dev=%s, clock=%s, rate=%ld",
+               __entry->devname, __entry->clockname,
+               __entry->rate)
+);
+
+TRACE_EVENT(nvhost_module_update_rate,
+       TP_PROTO(const char *devname, const char *clockname,
+               unsigned long rate),
+
+       TP_ARGS(devname, clockname, rate),
+
+       TP_STRUCT__entry(
+               __field(const char *, devname)
+               __field(const char *, clockname)
+               __field(unsigned long, rate)
+       ),
+
+       TP_fast_assign(
+               __entry->devname = devname;
+               __entry->clockname = clockname;
+               __entry->rate = rate;
+       ),
+
+       TP_printk("dev=%s, clock=%s, rate=%ld",
+               __entry->devname, __entry->clockname,
+               __entry->rate)
+);
+
 #endif /*  _TRACE_NVHOST_H */
 
 /* This part must be outside protection */