* [PATCH v2 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints @ 2013-06-21 2:12 kpark3469 2013-06-21 2:12 ` [PATCH v2 2/4] PM / tracing: Add pm_qos_request tracepoints kpark3469 2013-06-24 22:34 ` [PATCH v2 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints Rafael J. Wysocki 0 siblings, 2 replies; 5+ messages in thread From: kpark3469 @ 2013-06-21 2:12 UTC (permalink / raw) To: linux-pm; +Cc: keun-o.park, len.brown, rjw, rostedt From: Sahara <keun-o.park@windriver.com> 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> --- include/trace/events/power.h | 51 ++++++++++++++++++++++++++++++++++++++++++ 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 427acab..f1e73bd 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h @@ -5,6 +5,7 @@ #define _TRACE_POWER_H #include <linux/ktime.h> +#include <linux/pm_qos.h> #include <linux/tracepoint.h> DECLARE_EVENT_CLASS(cpu, @@ -177,6 +178,56 @@ DEFINE_EVENT(power_domain, power_domain_target, TP_ARGS(name, state, cpu_id) ); + +/* + * The pm qos events are used for pm qos update + */ +DECLARE_EVENT_CLASS(pm_qos_update, + + TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), + + TP_ARGS(action, prev_value, curr_value), + + TP_STRUCT__entry( + __field( enum pm_qos_req_action, action ) + __field( int, prev_value ) + __field( int, curr_value ) + ), + + TP_fast_assign( + __entry->action = action; + __entry->prev_value = prev_value; + __entry->curr_value = curr_value; + ), + + TP_printk("action=%s prev_value=%d curr_value=%d", + __print_symbolic(__entry->action, + { PM_QOS_ADD_REQ, "ADD_REQ" }, + { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, + { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), + __entry->prev_value, __entry->curr_value) +); + +DEFINE_EVENT(pm_qos_update, pm_qos_update_target, + + TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), + + TP_ARGS(action, prev_value, curr_value) +); + +DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags, + + TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), + + TP_ARGS(action, prev_value, curr_value), + + TP_printk("action=%s prev_value=0x%x curr_value=0x%x", + __print_symbolic(__entry->action, + { PM_QOS_ADD_REQ, "ADD_REQ" }, + { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, + { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), + __entry->prev_value, __entry->curr_value) +); #endif /* _TRACE_POWER_H */ /* This part must be outside protection */ diff --git a/kernel/power/qos.c b/kernel/power/qos.c index f2f5f6e..4fb8d14 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -44,6 +44,7 @@ #include <linux/uaccess.h> #include <linux/export.h> +#include <trace/events/power.h> /* * 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, spin_unlock_irqrestore(&pm_qos_lock, flags); + trace_pm_qos_update_target(action, prev_value, curr_value); if (prev_value != curr_value) { blocking_notifier_call_chain(c->notifiers, (unsigned long)curr_value, @@ -272,6 +274,7 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf, spin_unlock_irqrestore(&pm_qos_lock, irqflags); + trace_pm_qos_update_flags(action, prev_value, curr_value); return prev_value != curr_value; } -- 1.7.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/4] PM / tracing: Add pm_qos_request tracepoints 2013-06-21 2:12 [PATCH v2 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints kpark3469 @ 2013-06-21 2:12 ` kpark3469 2013-06-21 2:12 ` [PATCH v2 3/4] PM / tracing: Add dev_pm_qos_request tracepoints kpark3469 2013-06-24 22:34 ` [PATCH v2 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints Rafael J. Wysocki 1 sibling, 1 reply; 5+ messages in thread From: kpark3469 @ 2013-06-21 2:12 UTC (permalink / raw) To: linux-pm; +Cc: keun-o.park, len.brown, rjw, rostedt From: Sahara <keun-o.park@windriver.com> 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> --- include/trace/events/power.h | 71 ++++++++++++++++++++++++++++++++++++++++++ kernel/power/qos.c | 5 +++ 2 files changed, 76 insertions(+), 0 deletions(-) diff --git a/include/trace/events/power.h b/include/trace/events/power.h index f1e73bd..6411f92 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h @@ -182,6 +182,77 @@ DEFINE_EVENT(power_domain, power_domain_target, /* * The pm qos events are used for pm qos update */ +DECLARE_EVENT_CLASS(pm_qos_request, + + TP_PROTO(int pm_qos_class, s32 value), + + TP_ARGS(pm_qos_class, value), + + TP_STRUCT__entry( + __field( int, pm_qos_class ) + __field( s32, value ) + ), + + TP_fast_assign( + __entry->pm_qos_class = pm_qos_class; + __entry->value = value; + ), + + TP_printk("pm_qos_class=%s value=%d", + __print_symbolic(__entry->pm_qos_class, + { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }, + { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" }, + { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }), + __entry->value) +); + +DEFINE_EVENT(pm_qos_request, pm_qos_add_request, + + TP_PROTO(int pm_qos_class, s32 value), + + TP_ARGS(pm_qos_class, value) +); + +DEFINE_EVENT(pm_qos_request, pm_qos_update_request, + + TP_PROTO(int pm_qos_class, s32 value), + + TP_ARGS(pm_qos_class, value) +); + +DEFINE_EVENT(pm_qos_request, pm_qos_remove_request, + + TP_PROTO(int pm_qos_class, s32 value), + + TP_ARGS(pm_qos_class, value) +); + +TRACE_EVENT(pm_qos_update_request_timeout, + + TP_PROTO(int pm_qos_class, s32 value, unsigned long timeout_us), + + TP_ARGS(pm_qos_class, value, timeout_us), + + TP_STRUCT__entry( + __field( int, pm_qos_class ) + __field( s32, value ) + __field( unsigned long, timeout_us ) + ), + + TP_fast_assign( + __entry->pm_qos_class = pm_qos_class; + __entry->value = value; + __entry->timeout_us = timeout_us; + ), + + TP_printk("pm_qos_class=%s value=%d, timeout_us=%ld", + __print_symbolic(__entry->pm_qos_class, + { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }, + { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" }, + { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }), + __entry->value, __entry->timeout_us) +); + DECLARE_EVENT_CLASS(pm_qos_update, 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 4fb8d14..06fe285 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, } req->pm_qos_class = pm_qos_class; INIT_DELAYED_WORK(&req->work, pm_qos_work_fn); + trace_pm_qos_add_request(pm_qos_class, value); pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints, &req->node, PM_QOS_ADD_REQ, value); } @@ -364,6 +365,7 @@ void pm_qos_update_request(struct pm_qos_request *req, cancel_delayed_work_sync(&req->work); + trace_pm_qos_update_request(req->pm_qos_class, new_value); if (new_value != req->node.prio) pm_qos_update_target( 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, cancel_delayed_work_sync(&req->work); + trace_pm_qos_update_request_timeout(req->pm_qos_class, + new_value, timeout_us); if (new_value != req->node.prio) pm_qos_update_target( pm_qos_array[req->pm_qos_class]->constraints, @@ -419,6 +423,7 @@ void pm_qos_remove_request(struct pm_qos_request *req) cancel_delayed_work_sync(&req->work); + trace_pm_qos_remove_request(req->pm_qos_class, PM_QOS_DEFAULT_VALUE); pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); -- 1.7.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 3/4] PM / tracing: Add dev_pm_qos_request tracepoints 2013-06-21 2:12 ` [PATCH v2 2/4] PM / tracing: Add pm_qos_request tracepoints kpark3469 @ 2013-06-21 2:12 ` kpark3469 2013-06-21 2:12 ` [PATCH v2 4/4] Documentation: Add pm_qos and dev_pm_qos to events-power.txt kpark3469 0 siblings, 1 reply; 5+ messages in thread From: kpark3469 @ 2013-06-21 2:12 UTC (permalink / raw) To: linux-pm; +Cc: keun-o.park, len.brown, rjw, rostedt From: Sahara <keun-o.park@windriver.com> Adds tracepoints to dev_pm_qos_add_request, dev_pm_qos_update_request, and dev_pm_qos_remove_request. It's useful for checking device name, dev_pm_qos_request_type, and value. Signed-off-by: Sahara <keun-o.park@windriver.com> --- drivers/base/power/qos.c | 6 +++++ include/trace/events/power.h | 51 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 0 deletions(-) diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 71671c4..5c1361a 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c @@ -42,6 +42,7 @@ #include <linux/export.h> #include <linux/pm_runtime.h> #include <linux/err.h> +#include <trace/events/power.h> #include "power.h" @@ -305,6 +306,7 @@ int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, else if (!dev->power.qos) ret = dev_pm_qos_constraints_allocate(dev); + trace_dev_pm_qos_add_request(dev_name(dev), type, value); if (!ret) { req->dev = dev; req->type = type; @@ -349,6 +351,8 @@ static int __dev_pm_qos_update_request(struct dev_pm_qos_request *req, return -EINVAL; } + trace_dev_pm_qos_update_request(dev_name(req->dev), req->type, + new_value); if (curr_value != new_value) ret = apply_constraint(req, PM_QOS_UPDATE_REQ, new_value); @@ -398,6 +402,8 @@ static int __dev_pm_qos_remove_request(struct dev_pm_qos_request *req) if (IS_ERR_OR_NULL(req->dev->power.qos)) return -ENODEV; + trace_dev_pm_qos_remove_request(dev_name(req->dev), req->type, + PM_QOS_DEFAULT_VALUE); ret = apply_constraint(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); memset(req, 0, sizeof(*req)); return ret; diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 6411f92..8e42410 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h @@ -299,6 +299,57 @@ DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags, { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), __entry->prev_value, __entry->curr_value) ); + +DECLARE_EVENT_CLASS(dev_pm_qos_request, + + TP_PROTO(const char *name, enum dev_pm_qos_req_type type, + s32 new_value), + + TP_ARGS(name, type, new_value), + + TP_STRUCT__entry( + __string( name, name ) + __field( enum dev_pm_qos_req_type, type ) + __field( s32, new_value ) + ), + + TP_fast_assign( + __assign_str(name, name); + __entry->type = type; + __entry->new_value = new_value; + ), + + TP_printk("device=%s type=%s new_value=%d", + __get_str(name), + __print_symbolic(__entry->type, + { DEV_PM_QOS_LATENCY, "DEV_PM_QOS_LATENCY" }, + { DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS" }), + __entry->new_value) +); + +DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_add_request, + + TP_PROTO(const char *name, enum dev_pm_qos_req_type type, + s32 new_value), + + TP_ARGS(name, type, new_value) +); + +DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_update_request, + + TP_PROTO(const char *name, enum dev_pm_qos_req_type type, + s32 new_value), + + TP_ARGS(name, type, new_value) +); + +DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request, + + TP_PROTO(const char *name, enum dev_pm_qos_req_type type, + s32 new_value), + + TP_ARGS(name, type, new_value) +); #endif /* _TRACE_POWER_H */ /* This part must be outside protection */ -- 1.7.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 4/4] Documentation: Add pm_qos and dev_pm_qos to events-power.txt 2013-06-21 2:12 ` [PATCH v2 3/4] PM / tracing: Add dev_pm_qos_request tracepoints kpark3469 @ 2013-06-21 2:12 ` kpark3469 0 siblings, 0 replies; 5+ messages in thread From: kpark3469 @ 2013-06-21 2:12 UTC (permalink / raw) To: linux-pm; +Cc: keun-o.park, len.brown, rjw, rostedt From: Sahara <keun-o.park@windriver.com> Add PM QOS events section and description to events-power.txt. Signed-off-by: Sahara <keun-o.park@windriver.com> --- Documentation/trace/events-power.txt | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt index e1498ff..90ebab6 100644 --- a/Documentation/trace/events-power.txt +++ b/Documentation/trace/events-power.txt @@ -63,3 +63,34 @@ power_domain_target "%s state=%lu cpu_id=%lu" The first parameter gives the power domain name (e.g. "mpu_pwrdm"). The second parameter is the power domain target state. +4. PM QOS events +================ +The pm qos events are used for qos add/update/remove request and for +target/flags update. + +pm_qos_add_request "pm_qos_class=%s value=%d" +pm_qos_update_request "pm_qos_class=%s value=%d" +pm_qos_remove_request "pm_qos_class=%s value=%d" +pm_qos_update_request_timeout "pm_qos_class=%s value=%d, timeout_us=%ld" + +The first parameter gives the qos class name (e.g. "CPU_DMA_LATENCY"). +The second parameter is value to be added/updated/removed. +The third parameter is timeout value in usec. + +pm_qos_update_target "action=%s prev_value=%d curr_value=%d" +pm_qos_update_flags "action=%s prev_value=0x%x curr_value=0x%x" + +The first parameter gives the qos action name (e.g. "ADD_REQ"). +The second parameter is the previous qos value. +The third parameter is the current qos value to update. + +And, there are also events used for device pm qos add/update/remove request. + +dev_pm_qos_add_request "device=%s type=%s new_value=%d" +dev_pm_qos_update_request "device=%s type=%s new_value=%d" +dev_pm_qos_remove_request "device=%s type=%s new_value=%d" + +The first parameter gives the device name which tries to add/update/remove +qos requests. +The second parameter gives the request type (e.g. "DEV_PM_QOS_LATENCY"). +The third parameter is value to be added/updated/removed. -- 1.7.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints 2013-06-21 2:12 [PATCH v2 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints kpark3469 2013-06-21 2:12 ` [PATCH v2 2/4] PM / tracing: Add pm_qos_request tracepoints kpark3469 @ 2013-06-24 22:34 ` Rafael J. Wysocki 1 sibling, 0 replies; 5+ messages in thread From: Rafael J. Wysocki @ 2013-06-24 22:34 UTC (permalink / raw) To: kpark3469; +Cc: linux-pm, keun-o.park, len.brown, rostedt On Friday, June 21, 2013 11:12:28 AM kpark3469@gmail.com wrote: > From: Sahara <keun-o.park@windriver.com> > > 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> The entire series queued up for 3.11. Thanks, Rafael > --- > include/trace/events/power.h | 51 ++++++++++++++++++++++++++++++++++++++++++ > 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 427acab..f1e73bd 100644 > --- a/include/trace/events/power.h > +++ b/include/trace/events/power.h > @@ -5,6 +5,7 @@ > #define _TRACE_POWER_H > > #include <linux/ktime.h> > +#include <linux/pm_qos.h> > #include <linux/tracepoint.h> > > DECLARE_EVENT_CLASS(cpu, > @@ -177,6 +178,56 @@ DEFINE_EVENT(power_domain, power_domain_target, > > TP_ARGS(name, state, cpu_id) > ); > + > +/* > + * The pm qos events are used for pm qos update > + */ > +DECLARE_EVENT_CLASS(pm_qos_update, > + > + TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), > + > + TP_ARGS(action, prev_value, curr_value), > + > + TP_STRUCT__entry( > + __field( enum pm_qos_req_action, action ) > + __field( int, prev_value ) > + __field( int, curr_value ) > + ), > + > + TP_fast_assign( > + __entry->action = action; > + __entry->prev_value = prev_value; > + __entry->curr_value = curr_value; > + ), > + > + TP_printk("action=%s prev_value=%d curr_value=%d", > + __print_symbolic(__entry->action, > + { PM_QOS_ADD_REQ, "ADD_REQ" }, > + { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, > + { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), > + __entry->prev_value, __entry->curr_value) > +); > + > +DEFINE_EVENT(pm_qos_update, pm_qos_update_target, > + > + TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), > + > + TP_ARGS(action, prev_value, curr_value) > +); > + > +DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags, > + > + TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value), > + > + TP_ARGS(action, prev_value, curr_value), > + > + TP_printk("action=%s prev_value=0x%x curr_value=0x%x", > + __print_symbolic(__entry->action, > + { PM_QOS_ADD_REQ, "ADD_REQ" }, > + { PM_QOS_UPDATE_REQ, "UPDATE_REQ" }, > + { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }), > + __entry->prev_value, __entry->curr_value) > +); > #endif /* _TRACE_POWER_H */ > > /* This part must be outside protection */ > diff --git a/kernel/power/qos.c b/kernel/power/qos.c > index f2f5f6e..4fb8d14 100644 > --- a/kernel/power/qos.c > +++ b/kernel/power/qos.c > @@ -44,6 +44,7 @@ > > #include <linux/uaccess.h> > #include <linux/export.h> > +#include <trace/events/power.h> > > /* > * 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, > > spin_unlock_irqrestore(&pm_qos_lock, flags); > > + trace_pm_qos_update_target(action, prev_value, curr_value); > if (prev_value != curr_value) { > blocking_notifier_call_chain(c->notifiers, > (unsigned long)curr_value, > @@ -272,6 +274,7 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf, > > spin_unlock_irqrestore(&pm_qos_lock, irqflags); > > + trace_pm_qos_update_flags(action, prev_value, curr_value); > return prev_value != curr_value; > } > > -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-06-24 22:24 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-06-21 2:12 [PATCH v2 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints kpark3469 2013-06-21 2:12 ` [PATCH v2 2/4] PM / tracing: Add pm_qos_request tracepoints kpark3469 2013-06-21 2:12 ` [PATCH v2 3/4] PM / tracing: Add dev_pm_qos_request tracepoints kpark3469 2013-06-21 2:12 ` [PATCH v2 4/4] Documentation: Add pm_qos and dev_pm_qos to events-power.txt kpark3469 2013-06-24 22:34 ` [PATCH v2 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints Rafael J. Wysocki
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).