ARM: Tegra: clock: Clock set latency tracing
Antti P Miettinen [Mon, 15 Apr 2013 12:46:56 +0000 (15:46 +0300)]
Add traces for clock set latency measurements.

Change-Id: I5bdd00145f32da59ed294c8414d44fba8f3a81ca
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/219386
(cherry picked from commit 44d36b249a3e7d21d044a5742e870da85605ea33)
Reviewed-on: http://git-master/r/277485
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

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

index 7e0428d..3d5992e 100644 (file)
@@ -569,12 +569,16 @@ int clk_set_rate(struct clk *c, unsigned long rate)
        if (!c->ops || !c->ops->set_rate)
                return -ENOSYS;
 
+       trace_clock_set_start(c->name, rate, raw_smp_processor_id());
+
        clk_lock_save(c, &flags);
 
        ret = clk_set_rate_locked(c, rate);
 
        clk_unlock_restore(c, &flags);
 
+       trace_clock_set_done(c->name, rate, raw_smp_processor_id());
+
        return ret;
 }
 EXPORT_SYMBOL(clk_set_rate);
index a5ce804..023f999 100644 (file)
@@ -353,6 +353,20 @@ DEFINE_EVENT(clock, clock_unlock,
        TP_ARGS(name, state, cpu_id)
 );
 
+DEFINE_EVENT(clock, clock_set_start,
+
+       TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
+
+       TP_ARGS(name, state, cpu_id)
+);
+
+DEFINE_EVENT(clock, clock_set_done,
+
+       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
  */