Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207302
b: refs/heads/master
c: 22c5c03
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Winchester authored and Linus Torvalds committed Aug 10, 2010
1 parent 2eb7e37 commit e8382c7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 459b37d423104f00e87d1934821bc8739979d0e4
refs/heads/master: 22c5c03b42c082ab57b5d24824769ada0d90f8dc
34 changes: 20 additions & 14 deletions trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,27 +721,33 @@ core_param(initcall_debug, initcall_debug, bool, 0644);

static char msgbuf[64];

int do_one_initcall(initcall_t fn)
static int do_one_initcall_debug(initcall_t fn)
{
int count = preempt_count();
ktime_t calltime, delta, rettime;
unsigned long long duration;
int ret;

if (initcall_debug) {
printk("calling %pF @ %i\n", fn, task_pid_nr(current));
calltime = ktime_get();
}

printk(KERN_DEBUG "calling %pF @ %i\n", fn, task_pid_nr(current));
calltime = ktime_get();
ret = fn();
rettime = ktime_get();
delta = ktime_sub(rettime, calltime);
duration = (unsigned long long) ktime_to_ns(delta) >> 10;
printk(KERN_DEBUG "initcall %pF returned %d after %lld usecs\n", fn,
ret, duration);

if (initcall_debug) {
rettime = ktime_get();
delta = ktime_sub(rettime, calltime);
duration = (unsigned long long) ktime_to_ns(delta) >> 10;
printk("initcall %pF returned %d after %lld usecs\n", fn,
ret, duration);
}
return ret;
}

int do_one_initcall(initcall_t fn)
{
int count = preempt_count();
int ret;

if (initcall_debug)
ret = do_one_initcall_debug(fn);
else
ret = fn();

msgbuf[0] = 0;

Expand Down

0 comments on commit e8382c7

Please sign in to comment.