aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSahara <keun-o.park@windriver.com>2013-06-20 22:12:29 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-24 07:09:03 -0400
commitae8822b842e229fa4459fca2d979b630d812311d (patch)
treeb95b7c91426f15617cc370c874858e2d25b6fd9c
parent247e9ee034b0448a585afa16e292cbb9dc0aef68 (diff)
PM / QoS: Add pm_qos_request tracepoints
Adds tracepoints to pm_qos_add_request, pm_qos_update_request, pm_qos_remove_request, and pm_qos_update_request_timeout. It's useful for checking pm_qos_class, value, and timeout_us. 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.h71
-rw-r--r--kernel/power/qos.c5
2 files changed, 76 insertions, 0 deletions
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index f1e73bd04beb..6411f924afb1 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -182,6 +182,77 @@ DEFINE_EVENT(power_domain, power_domain_target,
182/* 182/*
183 * The pm qos events are used for pm qos update 183 * The pm qos events are used for pm qos update
184 */ 184 */
185DECLARE_EVENT_CLASS(pm_qos_request,
186
187 TP_PROTO(int pm_qos_class, s32 value),
188
189 TP_ARGS(pm_qos_class, value),
190
191 TP_STRUCT__entry(
192 __field( int, pm_qos_class )
193 __field( s32, value )
194 ),
195
196 TP_fast_assign(
197 __entry->pm_qos_class = pm_qos_class;
198 __entry->value = value;
199 ),
200
201 TP_printk("pm_qos_class=%s value=%d",
202 __print_symbolic(__entry->pm_qos_class,
203 { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" },
204 { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" },
205 { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }),
206 __entry->value)
207);
208
209DEFINE_EVENT(pm_qos_request, pm_qos_add_request,
210
211 TP_PROTO(int pm_qos_class, s32 value),
212
213 TP_ARGS(pm_qos_class, value)
214);
215
216DEFINE_EVENT(pm_qos_request, pm_qos_update_request,
217
218 TP_PROTO(int pm_qos_class, s32 value),
219
220 TP_ARGS(pm_qos_class, value)
221);
222
223DEFINE_EVENT(pm_qos_request, pm_qos_remove_request,
224
225 TP_PROTO(int pm_qos_class, s32 value),
226
227 TP_ARGS(pm_qos_class, value)
228);
229
230TRACE_EVENT(pm_qos_update_request_timeout,
231
232 TP_PROTO(int pm_qos_class, s32 value, unsigned long timeout_us),
233
234 TP_ARGS(pm_qos_class, value, timeout_us),
235
236 TP_STRUCT__entry(
237 __field( int, pm_qos_class )
238 __field( s32, value )
239 __field( unsigned long, timeout_us )
240 ),
241
242 TP_fast_assign(
243 __entry->pm_qos_class = pm_qos_class;
244 __entry->value = value;
245 __entry->timeout_us = timeout_us;
246 ),
247
248 TP_printk("pm_qos_class=%s value=%d, timeout_us=%ld",
249 __print_symbolic(__entry->pm_qos_class,
250 { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" },
251 { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" },
252 { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }),
253 __entry->value, __entry->timeout_us)
254);
255
185DECLARE_EVENT_CLASS(pm_qos_update, 256DECLARE_EVENT_CLASS(pm_qos_update,
186 257
187 TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), 258 TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index 4fb8d1427938..06fe28589e9c 100644
--- a/kernel/power/qos.c
+++ b/kernel/power/qos.c
@@ -336,6 +336,7 @@ void pm_qos_add_request(struct pm_qos_request *req,
336 } 336 }
337 req->pm_qos_class = pm_qos_class; 337 req->pm_qos_class = pm_qos_class;
338 INIT_DELAYED_WORK(&req->work, pm_qos_work_fn); 338 INIT_DELAYED_WORK(&req->work, pm_qos_work_fn);
339 trace_pm_qos_add_request(pm_qos_class, value);
339 pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints, 340 pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints,
340 &req->node, PM_QOS_ADD_REQ, value); 341 &req->node, PM_QOS_ADD_REQ, value);
341} 342}
@@ -364,6 +365,7 @@ void pm_qos_update_request(struct pm_qos_request *req,
364 365
365 cancel_delayed_work_sync(&req->work); 366 cancel_delayed_work_sync(&req->work);
366 367
368 trace_pm_qos_update_request(req->pm_qos_class, new_value);
367 if (new_value != req->node.prio) 369 if (new_value != req->node.prio)
368 pm_qos_update_target( 370 pm_qos_update_target(
369 pm_qos_array[req->pm_qos_class]->constraints, 371 pm_qos_array[req->pm_qos_class]->constraints,
@@ -390,6 +392,8 @@ void pm_qos_update_request_timeout(struct pm_qos_request *req, s32 new_value,
390 392
391 cancel_delayed_work_sync(&req->work); 393 cancel_delayed_work_sync(&req->work);
392 394
395 trace_pm_qos_update_request_timeout(req->pm_qos_class,
396 new_value, timeout_us);
393 if (new_value != req->node.prio) 397 if (new_value != req->node.prio)
394 pm_qos_update_target( 398 pm_qos_update_target(
395 pm_qos_array[req->pm_qos_class]->constraints, 399 pm_qos_array[req->pm_qos_class]->constraints,
@@ -419,6 +423,7 @@ void pm_qos_remove_request(struct pm_qos_request *req)
419 423
420 cancel_delayed_work_sync(&req->work); 424 cancel_delayed_work_sync(&req->work);
421 425
426 trace_pm_qos_remove_request(req->pm_qos_class, PM_QOS_DEFAULT_VALUE);
422 pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, 427 pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints,
423 &req->node, PM_QOS_REMOVE_REQ, 428 &req->node, PM_QOS_REMOVE_REQ,
424 PM_QOS_DEFAULT_VALUE); 429 PM_QOS_DEFAULT_VALUE);