diff options
author | Sahara <keun-o.park@windriver.com> | 2013-06-20 22:12:28 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-24 07:09:03 -0400 |
commit | 247e9ee034b0448a585afa16e292cbb9dc0aef68 (patch) | |
tree | a6feaff9bd5bf5116e79432b96ae3cb6f0345381 | |
parent | d30b82a46942cda5c0af3744142a650db0732a7c (diff) |
PM / QoS: Add pm_qos_update_target/flags tracepoints
This patch adds tracepoints to pm_qos_update_target and
pm_qos_update_flags. It's useful for checking pm qos action,
previous value and current value.
Signed-off-by: Sahara <keun-o.park@windriver.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | include/trace/events/power.h | 51 | ||||
-rw-r--r-- | kernel/power/qos.c | 3 |
2 files changed, 54 insertions, 0 deletions
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 427acab5d69a..f1e73bd04beb 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #define _TRACE_POWER_H | 5 | #define _TRACE_POWER_H |
6 | 6 | ||
7 | #include <linux/ktime.h> | 7 | #include <linux/ktime.h> |
8 | #include <linux/pm_qos.h> | ||
8 | #include <linux/tracepoint.h> | 9 | #include <linux/tracepoint.h> |
9 | 10 | ||
10 | DECLARE_EVENT_CLASS(cpu, | 11 | DECLARE_EVENT_CLASS(cpu, |
@@ -177,6 +178,56 @@ DEFINE_EVENT(power_domain, power_domain_target, | |||
177 | 178 | ||
178 | TP_ARGS(name, state, cpu_id) | 179 | TP_ARGS(name, state, cpu_id) |
179 | ); | 180 | ); |
181 | |||
182 | /* | ||
183 | * The pm qos events are used for pm qos update | ||
184 | */ | ||
185 | DECLARE_EVENT_CLASS(pm_qos_update, | ||
186 | |||
187 | TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), | ||
188 | |||
189 | TP_ARGS(action, prev_value, curr_value), | ||
190 | |||
191 | TP_STRUCT__entry( | ||
192 | __field( enum pm_qos_req_action, action ) | ||
193 | __field( int, prev_value ) | ||
194 | __field( int, curr_value ) | ||
195 | ), | ||
196 | |||
197 | TP_fast_assign( | ||
198 | __entry->action = action; | ||
199 | __entry->prev_value = prev_value; | ||
200 | __entry->curr_value = curr_value; | ||
201 | ), | ||
202 | |||
203 | TP_printk("action=%s prev_value=%d curr_value=%d", | ||
204 | __print_symbolic(__entry->action, | ||
205 | { PM_QOS_ADD_REQ, "ADD_REQ" }, | ||
206 | { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, | ||
207 | { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), | ||
208 | __entry->prev_value, __entry->curr_value) | ||
209 | ); | ||
210 | |||
211 | DEFINE_EVENT(pm_qos_update, pm_qos_update_target, | ||
212 | |||
213 | TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), | ||
214 | |||
215 | TP_ARGS(action, prev_value, curr_value) | ||
216 | ); | ||
217 | |||
218 | DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags, | ||
219 | |||
220 | TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), | ||
221 | |||
222 | TP_ARGS(action, prev_value, curr_value), | ||
223 | |||
224 | TP_printk("action=%s prev_value=0x%x curr_value=0x%x", | ||
225 | __print_symbolic(__entry->action, | ||
226 | { PM_QOS_ADD_REQ, "ADD_REQ" }, | ||
227 | { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, | ||
228 | { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), | ||
229 | __entry->prev_value, __entry->curr_value) | ||
230 | ); | ||
180 | #endif /* _TRACE_POWER_H */ | 231 | #endif /* _TRACE_POWER_H */ |
181 | 232 | ||
182 | /* This part must be outside protection */ | 233 | /* This part must be outside protection */ |
diff --git a/kernel/power/qos.c b/kernel/power/qos.c index f2f5f6e22a3c..4fb8d1427938 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c | |||
@@ -44,6 +44,7 @@ | |||
44 | 44 | ||
45 | #include <linux/uaccess.h> | 45 | #include <linux/uaccess.h> |
46 | #include <linux/export.h> | 46 | #include <linux/export.h> |
47 | #include <trace/events/power.h> | ||
47 | 48 | ||
48 | /* | 49 | /* |
49 | * locking rule: all changes to constraints or notifiers lists | 50 | * locking rule: all changes to constraints or notifiers lists |
@@ -202,6 +203,7 @@ int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, | |||
202 | 203 | ||
203 | spin_unlock_irqrestore(&pm_qos_lock, flags); | 204 | spin_unlock_irqrestore(&pm_qos_lock, flags); |
204 | 205 | ||
206 | trace_pm_qos_update_target(action, prev_value, curr_value); | ||
205 | if (prev_value != curr_value) { | 207 | if (prev_value != curr_value) { |
206 | blocking_notifier_call_chain(c->notifiers, | 208 | blocking_notifier_call_chain(c->notifiers, |
207 | (unsigned long)curr_value, | 209 | (unsigned long)curr_value, |
@@ -272,6 +274,7 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf, | |||
272 | 274 | ||
273 | spin_unlock_irqrestore(&pm_qos_lock, irqflags); | 275 | spin_unlock_irqrestore(&pm_qos_lock, irqflags); |
274 | 276 | ||
277 | trace_pm_qos_update_flags(action, prev_value, curr_value); | ||
275 | return prev_value != curr_value; | 278 | return prev_value != curr_value; |
276 | } | 279 | } |
277 | 280 | ||