From: kpark3469@gmail.com
To: linux-pm@vger.kernel.org
Cc: keun-o.park@windriver.com, len.brown@intel.com, rjw@sisk.pl,
rostedt@goodmis.org
Subject: [PATCH 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints
Date: Thu, 20 Jun 2013 13:56:57 +0900 [thread overview]
Message-ID: <1371704220-7008-1-git-send-email-kpark3469@gmail.com> (raw)
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 | 49 ++++++++++++++++++++++++++++++++++++++++++
kernel/power/qos.c | 3 ++
2 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 427acab..27a714c 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,54 @@ 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",
+ (__entry->action == PM_QOS_ADD_REQ) ? "ADD_REQ" :
+ (__entry->action == PM_QOS_UPDATE_REQ) ? "UPDATE_REQ" :
+ (__entry->action == 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",
+ (__entry->action == PM_QOS_ADD_REQ) ? "ADD_REQ" :
+ (__entry->action == PM_QOS_UPDATE_REQ) ? "UPDATE_REQ" :
+ (__entry->action == 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
next reply other threads:[~2013-06-20 4:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 4:56 kpark3469 [this message]
2013-06-20 4:56 ` [PATCH 2/4] PM / tracing: Add pm_qos_request tracepoints kpark3469
2013-06-20 4:56 ` [PATCH 3/4] PM / tracing: Add dev_pm_qos_request tracepoints kpark3469
2013-06-20 4:57 ` [PATCH 4/4] Documentation: Add pm_qos and dev_pm_qos to events-power.txt kpark3469
2013-06-20 12:35 ` [PATCH 1/4] PM / tracing: Add pm_qos_update_target/flags tracepoints Steven Rostedt
2013-06-21 2:16 ` Keun-O Park
2013-06-20 12:36 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371704220-7008-1-git-send-email-kpark3469@gmail.com \
--to=kpark3469@gmail.com \
--cc=keun-o.park@windriver.com \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).