tracing: Clock lock trace events
Antti P Miettinen [Fri, 10 Aug 2012 12:18:38 +0000 (15:18 +0300)]
Add tracing for clock lock/unlock operations.

Bug 960307

Change-Id: Id5c2d8be25900bc701e5dcd73f87c068ab6e5894
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/122666
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

arch/arm/mach-tegra/clock.h
include/trace/events/power.h

index c27176b..035a41c 100644 (file)
@@ -64,6 +64,7 @@
 #include <linux/list.h>
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
+#include <trace/events/power.h>
 #include <asm/cputime.h>
 
 #include <mach/clk.h>
@@ -281,6 +282,7 @@ static inline bool clk_cansleep(struct clk *c)
 
 static inline void clk_lock_save(struct clk *c, unsigned long *flags)
 {
+       trace_clock_lock(c->name, c->rate, smp_processor_id());
        if (clk_cansleep(c)) {
                *flags = 0;
                mutex_lock(&c->mutex);
@@ -295,6 +297,7 @@ static inline void clk_unlock_restore(struct clk *c, unsigned long *flags)
                mutex_unlock(&c->mutex);
        else
                spin_unlock_irqrestore(&c->spinlock, *flags);
+       trace_clock_unlock(c->name, c->rate, smp_processor_id());
 }
 
 static inline void clk_lock_init(struct clk *c)
index 5b503e9..a6be189 100644 (file)
@@ -306,6 +306,20 @@ DEFINE_EVENT(clock, clock_set_rate,
        TP_ARGS(name, state, cpu_id)
 );
 
+DEFINE_EVENT(clock, clock_lock,
+
+       TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
+
+       TP_ARGS(name, state, cpu_id)
+);
+
+DEFINE_EVENT(clock, clock_unlock,
+
+       TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
+
+       TP_ARGS(name, state, cpu_id)
+);
+
 /*
  * The power domain events are used for power domains transitions
  */