aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/init/main.c b/init/main.c
index ac2e4a5f59ee..e407a05adc29 100644
--- a/init/main.c
+++ b/init/main.c
@@ -66,11 +66,9 @@
66#include <linux/ftrace.h> 66#include <linux/ftrace.h>
67#include <linux/async.h> 67#include <linux/async.h>
68#include <linux/kmemcheck.h> 68#include <linux/kmemcheck.h>
69#include <linux/kmemtrace.h>
70#include <linux/sfi.h> 69#include <linux/sfi.h>
71#include <linux/shmem_fs.h> 70#include <linux/shmem_fs.h>
72#include <linux/slab.h> 71#include <linux/slab.h>
73#include <trace/boot.h>
74 72
75#include <asm/io.h> 73#include <asm/io.h>
76#include <asm/bugs.h> 74#include <asm/bugs.h>
@@ -655,7 +653,6 @@ asmlinkage void __init start_kernel(void)
655#endif 653#endif
656 page_cgroup_init(); 654 page_cgroup_init();
657 enable_debug_pagealloc(); 655 enable_debug_pagealloc();
658 kmemtrace_init();
659 kmemleak_init(); 656 kmemleak_init();
660 debug_objects_mem_init(); 657 debug_objects_mem_init();
661 idr_init_cache(); 658 idr_init_cache();
@@ -717,38 +714,33 @@ int initcall_debug;
717core_param(initcall_debug, initcall_debug, bool, 0644); 714core_param(initcall_debug, initcall_debug, bool, 0644);
718 715
719static char msgbuf[64]; 716static char msgbuf[64];
720static struct boot_trace_call call;
721static struct boot_trace_ret ret;
722 717
723int do_one_initcall(initcall_t fn) 718int do_one_initcall(initcall_t fn)
724{ 719{
725 int count = preempt_count(); 720 int count = preempt_count();
726 ktime_t calltime, delta, rettime; 721 ktime_t calltime, delta, rettime;
722 unsigned long long duration;
723 int ret;
727 724
728 if (initcall_debug) { 725 if (initcall_debug) {
729 call.caller = task_pid_nr(current); 726 printk("calling %pF @ %i\n", fn, task_pid_nr(current));
730 printk("calling %pF @ %i\n", fn, call.caller);
731 calltime = ktime_get(); 727 calltime = ktime_get();
732 trace_boot_call(&call, fn);
733 enable_boot_trace();
734 } 728 }
735 729
736 ret.result = fn(); 730 ret = fn();
737 731
738 if (initcall_debug) { 732 if (initcall_debug) {
739 disable_boot_trace();
740 rettime = ktime_get(); 733 rettime = ktime_get();
741 delta = ktime_sub(rettime, calltime); 734 delta = ktime_sub(rettime, calltime);
742 ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10; 735 duration = (unsigned long long) ktime_to_ns(delta) >> 10;
743 trace_boot_ret(&ret, fn); 736 printk("initcall %pF returned %d after %lld usecs\n", fn,
744 printk("initcall %pF returned %d after %Ld usecs\n", fn, 737 ret, duration);
745 ret.result, ret.duration);
746 } 738 }
747 739
748 msgbuf[0] = 0; 740 msgbuf[0] = 0;
749 741
750 if (ret.result && ret.result != -ENODEV && initcall_debug) 742 if (ret && ret != -ENODEV && initcall_debug)
751 sprintf(msgbuf, "error code %d ", ret.result); 743 sprintf(msgbuf, "error code %d ", ret);
752 744
753 if (preempt_count() != count) { 745 if (preempt_count() != count) {
754 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 746 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -762,7 +754,7 @@ int do_one_initcall(initcall_t fn)
762 printk("initcall %pF returned with %s\n", fn, msgbuf); 754 printk("initcall %pF returned with %s\n", fn, msgbuf);
763 } 755 }
764 756
765 return ret.result; 757 return ret;
766} 758}
767 759
768 760
@@ -882,7 +874,6 @@ static int __init kernel_init(void * unused)
882 smp_prepare_cpus(setup_max_cpus); 874 smp_prepare_cpus(setup_max_cpus);
883 875
884 do_pre_smp_initcalls(); 876 do_pre_smp_initcalls();
885 start_boot_trace();
886 877
887 smp_init(); 878 smp_init();
888 sched_init_smp(); 879 sched_init_smp();