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 4ddb53f04f2a..b03a4c1f69fa 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>
@@ -664,7 +662,6 @@ asmlinkage void __init start_kernel(void)
664#endif 662#endif
665 page_cgroup_init(); 663 page_cgroup_init();
666 enable_debug_pagealloc(); 664 enable_debug_pagealloc();
667 kmemtrace_init();
668 kmemleak_init(); 665 kmemleak_init();
669 debug_objects_mem_init(); 666 debug_objects_mem_init();
670 idr_init_cache(); 667 idr_init_cache();
@@ -726,38 +723,33 @@ int initcall_debug;
726core_param(initcall_debug, initcall_debug, bool, 0644); 723core_param(initcall_debug, initcall_debug, bool, 0644);
727 724
728static char msgbuf[64]; 725static char msgbuf[64];
729static struct boot_trace_call call;
730static struct boot_trace_ret ret;
731 726
732int do_one_initcall(initcall_t fn) 727int do_one_initcall(initcall_t fn)
733{ 728{
734 int count = preempt_count(); 729 int count = preempt_count();
735 ktime_t calltime, delta, rettime; 730 ktime_t calltime, delta, rettime;
731 unsigned long long duration;
732 int ret;
736 733
737 if (initcall_debug) { 734 if (initcall_debug) {
738 call.caller = task_pid_nr(current); 735 printk("calling %pF @ %i\n", fn, task_pid_nr(current));
739 printk("calling %pF @ %i\n", fn, call.caller);
740 calltime = ktime_get(); 736 calltime = ktime_get();
741 trace_boot_call(&call, fn);
742 enable_boot_trace();
743 } 737 }
744 738
745 ret.result = fn(); 739 ret = fn();
746 740
747 if (initcall_debug) { 741 if (initcall_debug) {
748 disable_boot_trace();
749 rettime = ktime_get(); 742 rettime = ktime_get();
750 delta = ktime_sub(rettime, calltime); 743 delta = ktime_sub(rettime, calltime);
751 ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10; 744 duration = (unsigned long long) ktime_to_ns(delta) >> 10;
752 trace_boot_ret(&ret, fn); 745 printk("initcall %pF returned %d after %lld usecs\n", fn,
753 printk("initcall %pF returned %d after %Ld usecs\n", fn, 746 ret, duration);
754 ret.result, ret.duration);
755 } 747 }
756 748
757 msgbuf[0] = 0; 749 msgbuf[0] = 0;
758 750
759 if (ret.result && ret.result != -ENODEV && initcall_debug) 751 if (ret && ret != -ENODEV && initcall_debug)
760 sprintf(msgbuf, "error code %d ", ret.result); 752 sprintf(msgbuf, "error code %d ", ret);
761 753
762 if (preempt_count() != count) { 754 if (preempt_count() != count) {
763 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 755 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -771,7 +763,7 @@ int do_one_initcall(initcall_t fn)
771 printk("initcall %pF returned with %s\n", fn, msgbuf); 763 printk("initcall %pF returned with %s\n", fn, msgbuf);
772 } 764 }
773 765
774 return ret.result; 766 return ret;
775} 767}
776 768
777 769
@@ -895,7 +887,6 @@ static int __init kernel_init(void * unused)
895 smp_prepare_cpus(setup_max_cpus); 887 smp_prepare_cpus(setup_max_cpus);
896 888
897 do_pre_smp_initcalls(); 889 do_pre_smp_initcalls();
898 start_boot_trace();
899 890
900 smp_init(); 891 smp_init();
901 sched_init_smp(); 892 sched_init_smp();