aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/init/main.c b/init/main.c
index 1e39a1eab190..61eb66159391 100644
--- a/init/main.c
+++ b/init/main.c
@@ -706,34 +706,32 @@ __setup("initcall_debug", initcall_debug_setup);
706int do_one_initcall(initcall_t fn) 706int do_one_initcall(initcall_t fn)
707{ 707{
708 int count = preempt_count(); 708 int count = preempt_count();
709 ktime_t t0, t1, delta; 709 ktime_t delta;
710 char msgbuf[64]; 710 char msgbuf[64];
711 int result;
712 struct boot_trace it; 711 struct boot_trace it;
713 712
714 if (initcall_debug) { 713 if (initcall_debug) {
715 it.caller = task_pid_nr(current); 714 it.caller = task_pid_nr(current);
716 it.func = fn; 715 it.func = fn;
717 printk("calling %pF @ %i\n", fn, it.caller); 716 printk("calling %pF @ %i\n", fn, it.caller);
718 t0 = ktime_get(); 717 it.calltime = ktime_get();
719 } 718 }
720 719
721 result = fn(); 720 it.result = fn();
722 721
723 if (initcall_debug) { 722 if (initcall_debug) {
724 t1 = ktime_get(); 723 it.rettime = ktime_get();
725 delta = ktime_sub(t1, t0); 724 delta = ktime_sub(it.rettime, it.calltime);
726 it.result = result;
727 it.duration = (unsigned long long) delta.tv64 >> 20; 725 it.duration = (unsigned long long) delta.tv64 >> 20;
728 printk("initcall %pF returned %d after %Ld msecs\n", fn, 726 printk("initcall %pF returned %d after %Ld msecs\n", fn,
729 result, it.duration); 727 it.result, it.duration);
730 trace_boot(&it); 728 trace_boot(&it);
731 } 729 }
732 730
733 msgbuf[0] = 0; 731 msgbuf[0] = 0;
734 732
735 if (result && result != -ENODEV && initcall_debug) 733 if (it.result && it.result != -ENODEV && initcall_debug)
736 sprintf(msgbuf, "error code %d ", result); 734 sprintf(msgbuf, "error code %d ", it.result);
737 735
738 if (preempt_count() != count) { 736 if (preempt_count() != count) {
739 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 737 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -747,7 +745,7 @@ int do_one_initcall(initcall_t fn)
747 printk("initcall %pF returned with %s\n", fn, msgbuf); 745 printk("initcall %pF returned with %s\n", fn, msgbuf);
748 } 746 }
749 747
750 return result; 748 return it.result;
751} 749}
752 750
753 751