diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/Kconfig | 1 | ||||
-rw-r--r-- | init/main.c | 36 |
2 files changed, 22 insertions, 15 deletions
diff --git a/init/Kconfig b/init/Kconfig index 0f5af409fef1..8a63c404ef44 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -815,6 +815,7 @@ config TRACEPOINTS | |||
815 | 815 | ||
816 | config MARKERS | 816 | config MARKERS |
817 | bool "Activate markers" | 817 | bool "Activate markers" |
818 | depends on TRACEPOINTS | ||
818 | help | 819 | help |
819 | Place an empty function call at each marker site. Can be | 820 | Place an empty function call at each marker site. Can be |
820 | dynamically changed for a probe function. | 821 | dynamically changed for a probe function. |
diff --git a/init/main.c b/init/main.c index 7e117a231af1..17e9757bfde2 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include <linux/signal.h> | 63 | #include <linux/signal.h> |
64 | #include <linux/idr.h> | 64 | #include <linux/idr.h> |
65 | #include <linux/ftrace.h> | 65 | #include <linux/ftrace.h> |
66 | #include <trace/boot.h> | ||
66 | 67 | ||
67 | #include <asm/io.h> | 68 | #include <asm/io.h> |
68 | #include <asm/bugs.h> | 69 | #include <asm/bugs.h> |
@@ -669,6 +670,7 @@ asmlinkage void __init start_kernel(void) | |||
669 | efi_enter_virtual_mode(); | 670 | efi_enter_virtual_mode(); |
670 | #endif | 671 | #endif |
671 | thread_info_cache_init(); | 672 | thread_info_cache_init(); |
673 | cred_init(); | ||
672 | fork_init(num_physpages); | 674 | fork_init(num_physpages); |
673 | proc_caches_init(); | 675 | proc_caches_init(); |
674 | buffer_init(); | 676 | buffer_init(); |
@@ -703,31 +705,35 @@ core_param(initcall_debug, initcall_debug, bool, 0644); | |||
703 | int do_one_initcall(initcall_t fn) | 705 | int do_one_initcall(initcall_t fn) |
704 | { | 706 | { |
705 | int count = preempt_count(); | 707 | int count = preempt_count(); |
706 | ktime_t delta; | 708 | ktime_t calltime, delta, rettime; |
707 | char msgbuf[64]; | 709 | char msgbuf[64]; |
708 | struct boot_trace it; | 710 | struct boot_trace_call call; |
711 | struct boot_trace_ret ret; | ||
709 | 712 | ||
710 | if (initcall_debug) { | 713 | if (initcall_debug) { |
711 | it.caller = task_pid_nr(current); | 714 | call.caller = task_pid_nr(current); |
712 | printk("calling %pF @ %i\n", fn, it.caller); | 715 | printk("calling %pF @ %i\n", fn, call.caller); |
713 | it.calltime = ktime_get(); | 716 | calltime = ktime_get(); |
717 | trace_boot_call(&call, fn); | ||
718 | enable_boot_trace(); | ||
714 | } | 719 | } |
715 | 720 | ||
716 | it.result = fn(); | 721 | ret.result = fn(); |
717 | 722 | ||
718 | if (initcall_debug) { | 723 | if (initcall_debug) { |
719 | it.rettime = ktime_get(); | 724 | disable_boot_trace(); |
720 | delta = ktime_sub(it.rettime, it.calltime); | 725 | rettime = ktime_get(); |
721 | it.duration = (unsigned long long) delta.tv64 >> 10; | 726 | delta = ktime_sub(rettime, calltime); |
727 | ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10; | ||
728 | trace_boot_ret(&ret, fn); | ||
722 | printk("initcall %pF returned %d after %Ld usecs\n", fn, | 729 | printk("initcall %pF returned %d after %Ld usecs\n", fn, |
723 | it.result, it.duration); | 730 | ret.result, ret.duration); |
724 | trace_boot(&it, fn); | ||
725 | } | 731 | } |
726 | 732 | ||
727 | msgbuf[0] = 0; | 733 | msgbuf[0] = 0; |
728 | 734 | ||
729 | if (it.result && it.result != -ENODEV && initcall_debug) | 735 | if (ret.result && ret.result != -ENODEV && initcall_debug) |
730 | sprintf(msgbuf, "error code %d ", it.result); | 736 | sprintf(msgbuf, "error code %d ", ret.result); |
731 | 737 | ||
732 | if (preempt_count() != count) { | 738 | if (preempt_count() != count) { |
733 | strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); | 739 | strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); |
@@ -741,7 +747,7 @@ int do_one_initcall(initcall_t fn) | |||
741 | printk("initcall %pF returned with %s\n", fn, msgbuf); | 747 | printk("initcall %pF returned with %s\n", fn, msgbuf); |
742 | } | 748 | } |
743 | 749 | ||
744 | return it.result; | 750 | return ret.result; |
745 | } | 751 | } |
746 | 752 | ||
747 | 753 | ||
@@ -882,7 +888,7 @@ static int __init kernel_init(void * unused) | |||
882 | * we're essentially up and running. Get rid of the | 888 | * we're essentially up and running. Get rid of the |
883 | * initmem segments and start the user-mode stuff.. | 889 | * initmem segments and start the user-mode stuff.. |
884 | */ | 890 | */ |
885 | stop_boot_trace(); | 891 | |
886 | init_post(); | 892 | init_post(); |
887 | return 0; | 893 | return 0; |
888 | } | 894 | } |