diff options
Diffstat (limited to 'init')
-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 3bdb152f412f..e2a2bf3a169f 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> |
@@ -653,7 +651,6 @@ asmlinkage void __init start_kernel(void) | |||
653 | #endif | 651 | #endif |
654 | page_cgroup_init(); | 652 | page_cgroup_init(); |
655 | enable_debug_pagealloc(); | 653 | enable_debug_pagealloc(); |
656 | kmemtrace_init(); | ||
657 | kmemleak_init(); | 654 | kmemleak_init(); |
658 | debug_objects_mem_init(); | 655 | debug_objects_mem_init(); |
659 | idr_init_cache(); | 656 | idr_init_cache(); |
@@ -715,38 +712,33 @@ int initcall_debug; | |||
715 | core_param(initcall_debug, initcall_debug, bool, 0644); | 712 | core_param(initcall_debug, initcall_debug, bool, 0644); |
716 | 713 | ||
717 | static char msgbuf[64]; | 714 | static char msgbuf[64]; |
718 | static struct boot_trace_call call; | ||
719 | static struct boot_trace_ret ret; | ||
720 | 715 | ||
721 | int do_one_initcall(initcall_t fn) | 716 | int do_one_initcall(initcall_t fn) |
722 | { | 717 | { |
723 | int count = preempt_count(); | 718 | int count = preempt_count(); |
724 | ktime_t calltime, delta, rettime; | 719 | ktime_t calltime, delta, rettime; |
720 | unsigned long long duration; | ||
721 | int ret; | ||
725 | 722 | ||
726 | if (initcall_debug) { | 723 | if (initcall_debug) { |
727 | call.caller = task_pid_nr(current); | 724 | printk("calling %pF @ %i\n", fn, task_pid_nr(current)); |
728 | printk("calling %pF @ %i\n", fn, call.caller); | ||
729 | calltime = ktime_get(); | 725 | calltime = ktime_get(); |
730 | trace_boot_call(&call, fn); | ||
731 | enable_boot_trace(); | ||
732 | } | 726 | } |
733 | 727 | ||
734 | ret.result = fn(); | 728 | ret = fn(); |
735 | 729 | ||
736 | if (initcall_debug) { | 730 | if (initcall_debug) { |
737 | disable_boot_trace(); | ||
738 | rettime = ktime_get(); | 731 | rettime = ktime_get(); |
739 | delta = ktime_sub(rettime, calltime); | 732 | delta = ktime_sub(rettime, calltime); |
740 | ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10; | 733 | duration = (unsigned long long) ktime_to_ns(delta) >> 10; |
741 | trace_boot_ret(&ret, fn); | 734 | printk("initcall %pF returned %d after %lld usecs\n", fn, |
742 | printk("initcall %pF returned %d after %Ld usecs\n", fn, | 735 | ret, duration); |
743 | ret.result, ret.duration); | ||
744 | } | 736 | } |
745 | 737 | ||
746 | msgbuf[0] = 0; | 738 | msgbuf[0] = 0; |
747 | 739 | ||
748 | if (ret.result && ret.result != -ENODEV && initcall_debug) | 740 | if (ret && ret != -ENODEV && initcall_debug) |
749 | sprintf(msgbuf, "error code %d ", ret.result); | 741 | sprintf(msgbuf, "error code %d ", ret); |
750 | 742 | ||
751 | if (preempt_count() != count) { | 743 | if (preempt_count() != count) { |
752 | strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); | 744 | strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); |
@@ -760,7 +752,7 @@ int do_one_initcall(initcall_t fn) | |||
760 | printk("initcall %pF returned with %s\n", fn, msgbuf); | 752 | printk("initcall %pF returned with %s\n", fn, msgbuf); |
761 | } | 753 | } |
762 | 754 | ||
763 | return ret.result; | 755 | return ret; |
764 | } | 756 | } |
765 | 757 | ||
766 | 758 | ||
@@ -880,7 +872,6 @@ static int __init kernel_init(void * unused) | |||
880 | smp_prepare_cpus(setup_max_cpus); | 872 | smp_prepare_cpus(setup_max_cpus); |
881 | 873 | ||
882 | do_pre_smp_initcalls(); | 874 | do_pre_smp_initcalls(); |
883 | start_boot_trace(); | ||
884 | 875 | ||
885 | smp_init(); | 876 | smp_init(); |
886 | sched_init_smp(); | 877 | sched_init_smp(); |