aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/main.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/init/main.c b/init/main.c
index 16ca1ee071c4..e810196bf2f2 100644
--- a/init/main.c
+++ b/init/main.c
@@ -704,33 +704,35 @@ core_param(initcall_debug, initcall_debug, bool, 0644);
704int do_one_initcall(initcall_t fn) 704int do_one_initcall(initcall_t fn)
705{ 705{
706 int count = preempt_count(); 706 int count = preempt_count();
707 ktime_t delta; 707 ktime_t calltime, delta, rettime;
708 char msgbuf[64]; 708 char msgbuf[64];
709 struct boot_trace it; 709 struct boot_trace_call call;
710 struct boot_trace_ret ret;
710 711
711 if (initcall_debug) { 712 if (initcall_debug) {
712 it.caller = task_pid_nr(current); 713 call.caller = task_pid_nr(current);
713 printk("calling %pF @ %i\n", fn, it.caller); 714 printk("calling %pF @ %i\n", fn, call.caller);
714 it.calltime = ktime_get(); 715 calltime = ktime_get();
716 trace_boot_call(&call, fn);
715 enable_boot_trace(); 717 enable_boot_trace();
716 } 718 }
717 719
718 it.result = fn(); 720 ret.result = fn();
719 721
720 if (initcall_debug) { 722 if (initcall_debug) {
721 it.rettime = ktime_get();
722 delta = ktime_sub(it.rettime, it.calltime);
723 it.duration = (unsigned long long) delta.tv64 >> 10;
724 printk("initcall %pF returned %d after %Ld usecs\n", fn,
725 it.result, it.duration);
726 trace_boot(&it, fn);
727 disable_boot_trace(); 723 disable_boot_trace();
724 rettime = ktime_get();
725 delta = ktime_sub(rettime, calltime);
726 ret.duration = (unsigned long long) delta.tv64 >> 10;
727 trace_boot_ret(&ret, fn);
728 printk("initcall %pF returned %d after %Ld usecs\n", fn,
729 ret.result, ret.duration);
728 } 730 }
729 731
730 msgbuf[0] = 0; 732 msgbuf[0] = 0;
731 733
732 if (it.result && it.result != -ENODEV && initcall_debug) 734 if (ret.result && ret.result != -ENODEV && initcall_debug)
733 sprintf(msgbuf, "error code %d ", it.result); 735 sprintf(msgbuf, "error code %d ", ret.result);
734 736
735 if (preempt_count() != count) { 737 if (preempt_count() != count) {
736 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 738 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -744,7 +746,7 @@ int do_one_initcall(initcall_t fn)
744 printk("initcall %pF returned with %s\n", fn, msgbuf); 746 printk("initcall %pF returned with %s\n", fn, msgbuf);
745 } 747 }
746 748
747 return it.result; 749 return ret.result;
748} 750}
749 751
750 752