summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/main.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/init/main.c b/init/main.c
index b8b6eff..dbee132 100644
--- a/init/main.c
+++ b/init/main.c
@@ -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;
OpenPOWER on IntegriCloud