aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/init/main.c b/init/main.c
index c1f999a3cf31..2a7ce0f8e453 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>
@@ -680,6 +681,7 @@ asmlinkage void __init start_kernel(void)
680 efi_enter_virtual_mode(); 681 efi_enter_virtual_mode();
681#endif 682#endif
682 thread_info_cache_init(); 683 thread_info_cache_init();
684 cred_init();
683 fork_init(num_physpages); 685 fork_init(num_physpages);
684 proc_caches_init(); 686 proc_caches_init();
685 buffer_init(); 687 buffer_init();
@@ -714,31 +716,35 @@ core_param(initcall_debug, initcall_debug, bool, 0644);
714int do_one_initcall(initcall_t fn) 716int do_one_initcall(initcall_t fn)
715{ 717{
716 int count = preempt_count(); 718 int count = preempt_count();
717 ktime_t delta; 719 ktime_t calltime, delta, rettime;
718 char msgbuf[64]; 720 char msgbuf[64];
719 struct boot_trace it; 721 struct boot_trace_call call;
722 struct boot_trace_ret ret;
720 723
721 if (initcall_debug) { 724 if (initcall_debug) {
722 it.caller = task_pid_nr(current); 725 call.caller = task_pid_nr(current);
723 printk("calling %pF @ %i\n", fn, it.caller); 726 printk("calling %pF @ %i\n", fn, call.caller);
724 it.calltime = ktime_get(); 727 calltime = ktime_get();
728 trace_boot_call(&call, fn);
729 enable_boot_trace();
725 } 730 }
726 731
727 it.result = fn(); 732 ret.result = fn();
728 733
729 if (initcall_debug) { 734 if (initcall_debug) {
730 it.rettime = ktime_get(); 735 disable_boot_trace();
731 delta = ktime_sub(it.rettime, it.calltime); 736 rettime = ktime_get();
732 it.duration = (unsigned long long) delta.tv64 >> 10; 737 delta = ktime_sub(rettime, calltime);
738 ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10;
739 trace_boot_ret(&ret, fn);
733 printk("initcall %pF returned %d after %Ld usecs\n", fn, 740 printk("initcall %pF returned %d after %Ld usecs\n", fn,
734 it.result, it.duration); 741 ret.result, ret.duration);
735 trace_boot(&it, fn);
736 } 742 }
737 743
738 msgbuf[0] = 0; 744 msgbuf[0] = 0;
739 745
740 if (it.result && it.result != -ENODEV && initcall_debug) 746 if (ret.result && ret.result != -ENODEV && initcall_debug)
741 sprintf(msgbuf, "error code %d ", it.result); 747 sprintf(msgbuf, "error code %d ", ret.result);
742 748
743 if (preempt_count() != count) { 749 if (preempt_count() != count) {
744 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 750 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -752,7 +758,7 @@ int do_one_initcall(initcall_t fn)
752 printk("initcall %pF returned with %s\n", fn, msgbuf); 758 printk("initcall %pF returned with %s\n", fn, msgbuf);
753 } 759 }
754 760
755 return it.result; 761 return ret.result;
756} 762}
757 763
758 764
@@ -893,7 +899,7 @@ static int __init kernel_init(void * unused)
893 * we're essentially up and running. Get rid of the 899 * we're essentially up and running. Get rid of the
894 * initmem segments and start the user-mode stuff.. 900 * initmem segments and start the user-mode stuff..
895 */ 901 */
896 stop_boot_trace(); 902
897 init_post(); 903 init_post();
898 return 0; 904 return 0;
899} 905}