public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tom.leiming@gmail.com
To: rjw@sisk.pl, stern@rowland.harvard.edu
Cc: linux-pm@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	rostedt@goodmis.org, fweisbec@gmail.com,
	Ming Lei <tom.leiming@gmail.com>
Subject: [RFC PATCH 2/2] PM/runtime: replace dev_dbg with trace_rpm_*
Date: Thu, 22 Sep 2011 12:11:41 +0800	[thread overview]
Message-ID: <1316664701-15273-2-git-send-email-tom.leiming@gmail.com> (raw)
In-Reply-To: <1316664701-15273-1-git-send-email-tom.leiming@gmail.com>

From: Ming Lei <tom.leiming@gmail.com>

This patch replaces dev_dbg with trace_rpm_* inside
the three important functions:

	rpm_idle
	rpm_suspend
	rpm_resume

Trace points have the below advantages compared with dev_dbg:

	- trace points include much runtime information(such as
	running cpu, current task, ...)

	- most of linux distributions may disable "verbose debug"
	driver debug compile switch, so it is very difficult to
	report/debug runtime pm related problems from distribution
	users without this kind of debug information.

	- for upstream kernel users, enableing the debug switch will
	produce many useless "rpm_resume" output, and it is very noise.

	- dev_dbg inside rpm_suspend/rpm_resume may have some effects
	on runtime pm behaviour of console devicer

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 drivers/base/power/runtime.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index acb3f83..f41469a 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -9,6 +9,7 @@
 
 #include <linux/sched.h>
 #include <linux/pm_runtime.h>
+#include <trace/events/rpm.h>
 #include "power.h"
 
 static int rpm_resume(struct device *dev, int rpmflags);
@@ -171,6 +172,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
 	int (*callback)(struct device *);
 	int retval;
 
+	trace_rpm_idle(dev, rpmflags);
 	retval = rpm_check_suspend_allowed(dev);
 	if (retval < 0)
 		;	/* Conditions are wrong. */
@@ -243,6 +245,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
 	wake_up_all(&dev->power.wait_queue);
 
  out:
+	trace_rpm_return_int(dev, __func__, retval);
 	return retval;
 }
 
@@ -295,7 +298,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	struct device *parent = NULL;
 	int retval;
 
-	dev_dbg(dev, "%s flags 0x%x\n", __func__, rpmflags);
+	trace_rpm_suspend(dev, rpmflags);
 
  repeat:
 	retval = rpm_check_suspend_allowed(dev);
@@ -430,7 +433,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
 	}
 
  out:
-	dev_dbg(dev, "%s returns %d\n", __func__, retval);
+	trace_rpm_return_int(dev, __func__, retval);
 
 	return retval;
 }
@@ -459,7 +462,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
 	struct device *parent = NULL;
 	int retval = 0;
 
-	dev_dbg(dev, "%s flags 0x%x\n", __func__, rpmflags);
+	trace_rpm_resume(dev, rpmflags);
 
  repeat:
 	if (dev->power.runtime_error)
@@ -615,7 +618,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
 		spin_lock_irq(&dev->power.lock);
 	}
 
-	dev_dbg(dev, "%s returns %d\n", __func__, retval);
+	trace_rpm_return_int(dev, __func__, retval);
 
 	return retval;
 }
-- 
1.7.5.4


  reply	other threads:[~2011-09-22  4:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22  4:11 [RFC PATCH 1/2] PM/runtime: introduce trace points for tracing rpm_* functions tom.leiming
2011-09-22  4:11 ` tom.leiming [this message]
2011-09-25 14:43 ` Rafael J. Wysocki
2011-09-26 13:40 ` Steven Rostedt
2011-09-27  0:53   ` Ming Lei
2011-09-27  1:11     ` Steven Rostedt
2011-09-27  1:45       ` Ming Lei
2011-09-27  2:37         ` 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=1316664701-15273-2-git-send-email-tom.leiming@gmail.com \
    --to=tom.leiming@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mingo@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=rostedt@goodmis.org \
    --cc=stern@rowland.harvard.edu \
    /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