From c7984141ec47a2b5d2dcae276d4264f523b231d1 Mon Sep 17 00:00:00 2001 From: Matt Wagantall Date: Mon, 30 Jul 2012 19:47:52 -0700 Subject: [PATCH] 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 Signed-off-by: Stephen Boyd [abhimany: resolve trivial merge conflicts] Signed-off-by: Abhimanyu Kapur --- include/trace/events/power.h | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 9c75816079f6..5c618e97ad18 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h @@ -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),