summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntti P Miettinen <amiettinen@nvidia.com>2012-04-02 14:27:21 +0300
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-04-12 22:57:43 -0700
commit8873b7662b507bd006bc5054ac08310c98aecbdc (patch)
tree149d70322905bbc0717c65a40f1824735335e44d
parent8f76645dc5aacdfd9398a13963a3b177821713d2 (diff)
tracing: Add tracepoints for cluster switch
Simple trace points for measuring cluster switch latencies. Bug 958262 Change-Id: Ia1e5e13131d5e55aaa0a44e9e8b5196539df54e7 Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com> Reviewed-on: http://git-master/r/93841 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/pm.c8
-rw-r--r--include/trace/events/power.h23
2 files changed, 29 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index e0a33c1da395..e53effb9b669 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -45,6 +45,8 @@
#include <linux/pm_qos_params.h>
#include <linux/tegra_audio.h>
+#include <trace/events/power.h>
+
#include <asm/cacheflush.h>
#include <asm/cpu_pm.h>
#include <asm/hardware/gic.h>
@@ -534,6 +536,7 @@ unsigned int tegra_idle_lp2_last(unsigned int sleep_time, unsigned int flags)
* are in LP2 state and irqs are disabled
*/
if (flags & TEGRA_POWER_CLUSTER_MASK) {
+ trace_cpu_cluster(POWER_CPU_CLUSTER_START);
set_power_timers(pdata->cpu_timer, 0,
clk_get_rate_all_locked(tegra_pclk));
tegra_cluster_switch_prolog(mode);
@@ -570,9 +573,10 @@ unsigned int tegra_idle_lp2_last(unsigned int sleep_time, unsigned int flags)
if (sleep_time)
tegra_lp2_set_trigger(0);
- if (flags & TEGRA_POWER_CLUSTER_MASK)
+ if (flags & TEGRA_POWER_CLUSTER_MASK) {
tegra_cluster_switch_epilog(mode);
-
+ trace_cpu_cluster(POWER_CPU_CLUSTER_DONE);
+ }
tegra_cluster_switch_time(flags, tegra_cluster_switch_time_id_epilog);
#if INSTRUMENT_CLUSTER_SWITCH
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 63031aa5b6dd..9c9699a2b457 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -52,6 +52,11 @@ enum {
POWER_CPU_SCALE_DONE,
};
+enum {
+ POWER_CPU_CLUSTER_START,
+ POWER_CPU_CLUSTER_DONE,
+};
+
#endif
TRACE_EVENT(cpu_hotplug,
@@ -99,6 +104,24 @@ TRACE_EVENT(cpu_scale,
(unsigned long)__entry->state)
);
+TRACE_EVENT(cpu_cluster,
+
+ TP_PROTO(int state),
+
+ TP_ARGS(state),
+
+ TP_STRUCT__entry(
+ __field(u64, state)
+ ),
+
+ TP_fast_assign(
+ __entry->state = state;
+ ),
+
+ TP_printk("state=%lu",
+ (unsigned long)__entry->state)
+);
+
DEFINE_EVENT(cpu, cpu_frequency,
TP_PROTO(unsigned int frequency, unsigned int cpu_id),