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