msm: clock: Hook into clock tracepoints
Tracepoints already exist for clk_enable(), clk_disable(), and
clk_set_rate(). Add callbacks for these tracepoints so that we
can easily trace clock operations in the kernel.
For example:
# pwd
/sys/kernel/debug/tracing
# echo 1 > events/power/clock_enable/enable
# cat trace
<lots of clock enables>
Change-Id: I3b845653be427ff4b33bb31b5b82f73c4695d230
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
index 7f0cafd..884a27e 100644
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -21,6 +21,7 @@
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
+#include <trace/events/power.h>
#include "clock.h"
@@ -192,6 +193,7 @@
ret = vote_rate_vdd(clk, clk->rate);
if (ret)
goto err_vote_vdd;
+ trace_clock_enable(clk->dbg_name, 1, smp_processor_id());
if (clk->ops->enable)
ret = clk->ops->enable(clk);
if (ret)
@@ -242,6 +244,7 @@
if (clk->count == 1) {
struct clk *parent = clk_get_parent(clk);
+ trace_clock_disable(clk->dbg_name, 0, smp_processor_id());
if (clk->ops->disable)
clk->ops->disable(clk);
unvote_rate_vdd(clk, clk->rate);
@@ -312,6 +315,7 @@
return -ENOSYS;
spin_lock_irqsave(&clk->lock, flags);
+ trace_clock_set_rate(clk->dbg_name, rate, smp_processor_id());
if (clk->count) {
start_rate = clk->rate;
/* Enforce vdd requirements for target frequency. */