aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2011-09-27 16:54:41 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-09-27 16:54:41 -0400
commitc3dc2f14622a06488f11452b6efd1e02c5a8548b (patch)
treed1fc5bc15c8fc593457fffd9e90e66498c14e196
parent53b615ccca567ada1931eb04ad0614ac150c14a3 (diff)
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: Ming Lei <ming.lei@canonical.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r--drivers/base/power/runtime.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index aecb2a887ed7..7a6fb5e34a0e 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -9,6 +9,7 @@
9 9
10#include <linux/sched.h> 10#include <linux/sched.h>
11#include <linux/pm_runtime.h> 11#include <linux/pm_runtime.h>
12#include <trace/events/rpm.h>
12#include "power.h" 13#include "power.h"
13 14
14static int rpm_resume(struct device *dev, int rpmflags); 15static int rpm_resume(struct device *dev, int rpmflags);
@@ -196,6 +197,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
196 int (*callback)(struct device *); 197 int (*callback)(struct device *);
197 int retval; 198 int retval;
198 199
200 trace_rpm_idle(dev, rpmflags);
199 retval = rpm_check_suspend_allowed(dev); 201 retval = rpm_check_suspend_allowed(dev);
200 if (retval < 0) 202 if (retval < 0)
201 ; /* Conditions are wrong. */ 203 ; /* Conditions are wrong. */
@@ -257,6 +259,7 @@ static int rpm_idle(struct device *dev, int rpmflags)
257 wake_up_all(&dev->power.wait_queue); 259 wake_up_all(&dev->power.wait_queue);
258 260
259 out: 261 out:
262 trace_rpm_return_int(dev, _THIS_IP_, retval);
260 return retval; 263 return retval;
261} 264}
262 265
@@ -301,7 +304,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
301 struct device *parent = NULL; 304 struct device *parent = NULL;
302 int retval; 305 int retval;
303 306
304 dev_dbg(dev, "%s flags 0x%x\n", __func__, rpmflags); 307 trace_rpm_suspend(dev, rpmflags);
305 308
306 repeat: 309 repeat:
307 retval = rpm_check_suspend_allowed(dev); 310 retval = rpm_check_suspend_allowed(dev);
@@ -445,7 +448,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
445 } 448 }
446 449
447 out: 450 out:
448 dev_dbg(dev, "%s returns %d\n", __func__, retval); 451 trace_rpm_return_int(dev, _THIS_IP_, retval);
449 452
450 return retval; 453 return retval;
451} 454}
@@ -474,7 +477,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
474 struct device *parent = NULL; 477 struct device *parent = NULL;
475 int retval = 0; 478 int retval = 0;
476 479
477 dev_dbg(dev, "%s flags 0x%x\n", __func__, rpmflags); 480 trace_rpm_resume(dev, rpmflags);
478 481
479 repeat: 482 repeat:
480 if (dev->power.runtime_error) 483 if (dev->power.runtime_error)
@@ -639,7 +642,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
639 spin_lock_irq(&dev->power.lock); 642 spin_lock_irq(&dev->power.lock);
640 } 643 }
641 644
642 dev_dbg(dev, "%s returns %d\n", __func__, retval); 645 trace_rpm_return_int(dev, _THIS_IP_, retval);
643 646
644 return retval; 647 return retval;
645} 648}