Commit c3dc2f14 authored by Ming Lei's avatar Ming Lei Committed by Rafael J. Wysocki

PM / Runtime: Replace dev_dbg() with trace_rpm_*()

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: default avatarMing Lei <ming.lei@canonical.com>
Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 53b615cc
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <trace/events/rpm.h>
#include "power.h" #include "power.h"
static int rpm_resume(struct device *dev, int rpmflags); static int rpm_resume(struct device *dev, int rpmflags);
...@@ -196,6 +197,7 @@ static int rpm_idle(struct device *dev, int rpmflags) ...@@ -196,6 +197,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
int (*callback)(struct device *); int (*callback)(struct device *);
int retval; int retval;
trace_rpm_idle(dev, rpmflags);
retval = rpm_check_suspend_allowed(dev); retval = rpm_check_suspend_allowed(dev);
if (retval < 0) if (retval < 0)
; /* Conditions are wrong. */ ; /* Conditions are wrong. */
...@@ -257,6 +259,7 @@ static int rpm_idle(struct device *dev, int rpmflags) ...@@ -257,6 +259,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
wake_up_all(&dev->power.wait_queue); wake_up_all(&dev->power.wait_queue);
out: out:
trace_rpm_return_int(dev, _THIS_IP_, retval);
return retval; return retval;
} }
...@@ -301,7 +304,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) ...@@ -301,7 +304,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
struct device *parent = NULL; struct device *parent = NULL;
int retval; int retval;
dev_dbg(dev, "%s flags 0x%x\n", __func__, rpmflags); trace_rpm_suspend(dev, rpmflags);
repeat: repeat:
retval = rpm_check_suspend_allowed(dev); retval = rpm_check_suspend_allowed(dev);
...@@ -445,7 +448,7 @@ static int rpm_suspend(struct device *dev, int rpmflags) ...@@ -445,7 +448,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
} }
out: out:
dev_dbg(dev, "%s returns %d\n", __func__, retval); trace_rpm_return_int(dev, _THIS_IP_, retval);
return retval; return retval;
} }
...@@ -474,7 +477,7 @@ static int rpm_resume(struct device *dev, int rpmflags) ...@@ -474,7 +477,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
struct device *parent = NULL; struct device *parent = NULL;
int retval = 0; int retval = 0;
dev_dbg(dev, "%s flags 0x%x\n", __func__, rpmflags); trace_rpm_resume(dev, rpmflags);
repeat: repeat:
if (dev->power.runtime_error) if (dev->power.runtime_error)
...@@ -639,7 +642,7 @@ static int rpm_resume(struct device *dev, int rpmflags) ...@@ -639,7 +642,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
spin_lock_irq(&dev->power.lock); spin_lock_irq(&dev->power.lock);
} }
dev_dbg(dev, "%s returns %d\n", __func__, retval); trace_rpm_return_int(dev, _THIS_IP_, retval);
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment