trace: power: add cpu_frequency_switch_{start, end}

It is sometimes useful to profile how long CPU frequency switches
take, since they often involve variable overhead (PLL lock times,
voltage increase time, etc.). Add additional traces to to make this
possible.

Since the overhead involved may differ based on the frequencies
being switched between, record both the start and the end frequencies
as part of the trace.

Change-Id: I2de743fc357dad3590fd4980f65f38f6073d426e
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
[abhimany: resolve trivial merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
This commit is contained in:
Matt Wagantall 2012-07-30 19:47:52 -07:00 committed by David Keitel
parent 7252c408d4
commit c7984141ec

View file

@ -145,6 +145,48 @@ TRACE_EVENT(cpu_frequency_limits,
(unsigned long)__entry->cpu_id)
);
TRACE_EVENT(cpu_frequency_switch_start,
TP_PROTO(unsigned int start_freq, unsigned int end_freq,
unsigned int cpu_id),
TP_ARGS(start_freq, end_freq, cpu_id),
TP_STRUCT__entry(
__field( u32, start_freq )
__field( u32, end_freq )
__field( u32, cpu_id )
),
TP_fast_assign(
__entry->start_freq = start_freq;
__entry->end_freq = end_freq;
__entry->cpu_id = cpu_id;
),
TP_printk("start=%lu end=%lu cpu_id=%lu",
(unsigned long)__entry->start_freq,
(unsigned long)__entry->end_freq,
(unsigned long)__entry->cpu_id)
);
TRACE_EVENT(cpu_frequency_switch_end,
TP_PROTO(unsigned int cpu_id),
TP_ARGS(cpu_id),
TP_STRUCT__entry(
__field( u32, cpu_id )
),
TP_fast_assign(
__entry->cpu_id = cpu_id;
),
TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id)
);
TRACE_EVENT(device_pm_callback_start,
TP_PROTO(struct device *dev, const char *pm_ops, int event),