msm: lpm-levels: Add ftrace events to track latency/sleep time

Add ftrace events to track latency, sleep time and next event time
when core enter low power modes.

Change-Id: I83a11d75d8144d866ef8da2a58af02a3b8067ed3
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Signed-off-by: Anil Kumar Mamidala <amami@codeaurora.org>
This commit is contained in:
Anil Kumar Mamidala 2015-01-22 13:55:17 +05:30
parent c96b0bd7cc
commit 90a34f69a6
2 changed files with 14 additions and 6 deletions

View file

@ -319,6 +319,8 @@ static int cpu_power_select(struct cpuidle_device *dev,
if (modified_time_us)
msm_pm_set_timer(modified_time_us);
trace_cpu_idle_enter(best_level, sleep_us, latency_us, next_event_us);
return best_level;
}
@ -702,7 +704,6 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
cpu_prepare(cluster, idx, true);
cluster_prepare(cluster, cpumask, idx, true);
trace_cpu_idle_enter(idx);
lpm_stats_cpu_enter(idx);
success = msm_cpu_pm_enter_sleep(cluster->cpu->levels[idx].mode, true);
lpm_stats_cpu_exit(idx, success);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012, 2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2014-2015 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -20,20 +20,27 @@
TRACE_EVENT(cpu_idle_enter,
TP_PROTO(int index),
TP_PROTO(int index, u32 sleep_us, u32 latency, u32 next_event_us),
TP_ARGS(index),
TP_ARGS(index, sleep_us, latency, next_event_us),
TP_STRUCT__entry(
__field(int, index)
__field(u32, sleep_us)
__field(u32, latency)
__field(u32, next_event_us)
),
TP_fast_assign(
__entry->index = index;
__entry->sleep_us = sleep_us;
__entry->latency = latency;
__entry->next_event_us = next_event_us;
),
TP_printk("idx:%d",
__entry->index)
TP_printk("idx:%d sleep_time:%u latency:%u next_event:%u",
__entry->index, __entry->sleep_us, __entry->latency,
__entry->next_event_us)
);
TRACE_EVENT(cpu_idle_exit,