Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177377
b: refs/heads/master
c: f251177
h: refs/heads/master
i:
  177375: 914754e
v: v3
  • Loading branch information
Arjan van de Ven authored and Rafael J. Wysocki committed Dec 15, 2009
1 parent 7d6c9fe commit 6f8a56e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d531c14d2ed4b24472a4d773f00ed6d1cd34ee7
refs/heads/master: f2511774863487e61b56a97da07ebf8dd61d7836
31 changes: 31 additions & 0 deletions trunk/drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/resume-trace.h>
#include <linux/rwsem.h>
#include <linux/interrupt.h>
#include <linux/sched.h>

#include "../base.h"
#include "power.h"
Expand Down Expand Up @@ -172,6 +173,13 @@ static int pm_op(struct device *dev,
pm_message_t state)
{
int error = 0;
ktime_t calltime, delta, rettime;

if (initcall_debug) {
pr_info("calling %s+ @ %i\n",
dev_name(dev), task_pid_nr(current));
calltime = ktime_get();
}

switch (state.event) {
#ifdef CONFIG_SUSPEND
Expand Down Expand Up @@ -219,6 +227,14 @@ static int pm_op(struct device *dev,
default:
error = -EINVAL;
}

if (initcall_debug) {
rettime = ktime_get();
delta = ktime_sub(rettime, calltime);
pr_info("call %s+ returned %d after %Ld usecs\n", dev_name(dev),
error, (unsigned long long)ktime_to_ns(delta) >> 10);
}

return error;
}

Expand All @@ -236,6 +252,13 @@ static int pm_noirq_op(struct device *dev,
pm_message_t state)
{
int error = 0;
ktime_t calltime, delta, rettime;

if (initcall_debug) {
pr_info("calling %s_i+ @ %i\n",
dev_name(dev), task_pid_nr(current));
calltime = ktime_get();
}

switch (state.event) {
#ifdef CONFIG_SUSPEND
Expand Down Expand Up @@ -283,6 +306,14 @@ static int pm_noirq_op(struct device *dev,
default:
error = -EINVAL;
}

if (initcall_debug) {
rettime = ktime_get();
delta = ktime_sub(rettime, calltime);
printk("initcall %s_i+ returned %d after %Ld usecs\n", dev_name(dev),
error, (unsigned long long)ktime_to_ns(delta) >> 10);
}

return error;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ void prepare_namespace(void);

extern void (*late_time_init)(void);

extern int initcall_debug;

#endif

#ifndef MODULE
Expand Down

0 comments on commit 6f8a56e

Please sign in to comment.