diff options
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/init/main.c b/init/main.c index 27f6bf6108e9..3e17a3bafe60 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/gfp.h> | 27 | #include <linux/gfp.h> |
28 | #include <linux/percpu.h> | 28 | #include <linux/percpu.h> |
29 | #include <linux/kmod.h> | 29 | #include <linux/kmod.h> |
30 | #include <linux/vmalloc.h> | ||
30 | #include <linux/kernel_stat.h> | 31 | #include <linux/kernel_stat.h> |
31 | #include <linux/start_kernel.h> | 32 | #include <linux/start_kernel.h> |
32 | #include <linux/security.h> | 33 | #include <linux/security.h> |
@@ -60,6 +61,7 @@ | |||
60 | #include <linux/sched.h> | 61 | #include <linux/sched.h> |
61 | #include <linux/signal.h> | 62 | #include <linux/signal.h> |
62 | #include <linux/idr.h> | 63 | #include <linux/idr.h> |
64 | #include <linux/ftrace.h> | ||
63 | 65 | ||
64 | #include <asm/io.h> | 66 | #include <asm/io.h> |
65 | #include <asm/bugs.h> | 67 | #include <asm/bugs.h> |
@@ -642,6 +644,7 @@ asmlinkage void __init start_kernel(void) | |||
642 | initrd_start = 0; | 644 | initrd_start = 0; |
643 | } | 645 | } |
644 | #endif | 646 | #endif |
647 | vmalloc_init(); | ||
645 | vfs_caches_init_early(); | 648 | vfs_caches_init_early(); |
646 | cpuset_init_early(); | 649 | cpuset_init_early(); |
647 | mem_init(); | 650 | mem_init(); |
@@ -687,6 +690,8 @@ asmlinkage void __init start_kernel(void) | |||
687 | 690 | ||
688 | acpi_early_init(); /* before LAPIC and SMP init */ | 691 | acpi_early_init(); /* before LAPIC and SMP init */ |
689 | 692 | ||
693 | ftrace_init(); | ||
694 | |||
690 | /* Do the rest non-__init'ed, we're now alive */ | 695 | /* Do the rest non-__init'ed, we're now alive */ |
691 | rest_init(); | 696 | rest_init(); |
692 | } | 697 | } |
@@ -703,30 +708,31 @@ __setup("initcall_debug", initcall_debug_setup); | |||
703 | int do_one_initcall(initcall_t fn) | 708 | int do_one_initcall(initcall_t fn) |
704 | { | 709 | { |
705 | int count = preempt_count(); | 710 | int count = preempt_count(); |
706 | ktime_t t0, t1, delta; | 711 | ktime_t delta; |
707 | char msgbuf[64]; | 712 | char msgbuf[64]; |
708 | int result; | 713 | struct boot_trace it; |
709 | 714 | ||
710 | if (initcall_debug) { | 715 | if (initcall_debug) { |
711 | printk("calling %pF @ %i\n", fn, task_pid_nr(current)); | 716 | it.caller = task_pid_nr(current); |
712 | t0 = ktime_get(); | 717 | printk("calling %pF @ %i\n", fn, it.caller); |
718 | it.calltime = ktime_get(); | ||
713 | } | 719 | } |
714 | 720 | ||
715 | result = fn(); | 721 | it.result = fn(); |
716 | 722 | ||
717 | if (initcall_debug) { | 723 | if (initcall_debug) { |
718 | t1 = ktime_get(); | 724 | it.rettime = ktime_get(); |
719 | delta = ktime_sub(t1, t0); | 725 | delta = ktime_sub(it.rettime, it.calltime); |
720 | 726 | it.duration = (unsigned long long) delta.tv64 >> 10; | |
721 | printk("initcall %pF returned %d after %Ld msecs\n", | 727 | printk("initcall %pF returned %d after %Ld usecs\n", fn, |
722 | fn, result, | 728 | it.result, it.duration); |
723 | (unsigned long long) delta.tv64 >> 20); | 729 | trace_boot(&it, fn); |
724 | } | 730 | } |
725 | 731 | ||
726 | msgbuf[0] = 0; | 732 | msgbuf[0] = 0; |
727 | 733 | ||
728 | if (result && result != -ENODEV && initcall_debug) | 734 | if (it.result && it.result != -ENODEV && initcall_debug) |
729 | sprintf(msgbuf, "error code %d ", result); | 735 | sprintf(msgbuf, "error code %d ", it.result); |
730 | 736 | ||
731 | if (preempt_count() != count) { | 737 | if (preempt_count() != count) { |
732 | strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); | 738 | strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); |
@@ -740,7 +746,7 @@ int do_one_initcall(initcall_t fn) | |||
740 | printk("initcall %pF returned with %s\n", fn, msgbuf); | 746 | printk("initcall %pF returned with %s\n", fn, msgbuf); |
741 | } | 747 | } |
742 | 748 | ||
743 | return result; | 749 | return it.result; |
744 | } | 750 | } |
745 | 751 | ||
746 | 752 | ||
@@ -855,6 +861,7 @@ static int __init kernel_init(void * unused) | |||
855 | smp_prepare_cpus(setup_max_cpus); | 861 | smp_prepare_cpus(setup_max_cpus); |
856 | 862 | ||
857 | do_pre_smp_initcalls(); | 863 | do_pre_smp_initcalls(); |
864 | start_boot_trace(); | ||
858 | 865 | ||
859 | smp_init(); | 866 | smp_init(); |
860 | sched_init_smp(); | 867 | sched_init_smp(); |
@@ -881,6 +888,7 @@ static int __init kernel_init(void * unused) | |||
881 | * we're essentially up and running. Get rid of the | 888 | * we're essentially up and running. Get rid of the |
882 | * initmem segments and start the user-mode stuff.. | 889 | * initmem segments and start the user-mode stuff.. |
883 | */ | 890 | */ |
891 | stop_boot_trace(); | ||
884 | init_post(); | 892 | init_post(); |
885 | return 0; | 893 | return 0; |
886 | } | 894 | } |