diff options
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/init/main.c b/init/main.c index 7e117a231af1..e810196bf2f2 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> |
@@ -703,31 +704,35 @@ core_param(initcall_debug, initcall_debug, bool, 0644); | |||
703 | int do_one_initcall(initcall_t fn) | 704 | int do_one_initcall(initcall_t fn) |
704 | { | 705 | { |
705 | int count = preempt_count(); | 706 | int count = preempt_count(); |
706 | ktime_t delta; | 707 | ktime_t calltime, delta, rettime; |
707 | char msgbuf[64]; | 708 | char msgbuf[64]; |
708 | struct boot_trace it; | 709 | struct boot_trace_call call; |
710 | struct boot_trace_ret ret; | ||
709 | 711 | ||
710 | if (initcall_debug) { | 712 | if (initcall_debug) { |
711 | it.caller = task_pid_nr(current); | 713 | call.caller = task_pid_nr(current); |
712 | printk("calling %pF @ %i\n", fn, it.caller); | 714 | printk("calling %pF @ %i\n", fn, call.caller); |
713 | it.calltime = ktime_get(); | 715 | calltime = ktime_get(); |
716 | trace_boot_call(&call, fn); | ||
717 | enable_boot_trace(); | ||
714 | } | 718 | } |
715 | 719 | ||
716 | it.result = fn(); | 720 | ret.result = fn(); |
717 | 721 | ||
718 | if (initcall_debug) { | 722 | if (initcall_debug) { |
719 | it.rettime = ktime_get(); | 723 | disable_boot_trace(); |
720 | delta = ktime_sub(it.rettime, it.calltime); | 724 | rettime = ktime_get(); |
721 | it.duration = (unsigned long long) delta.tv64 >> 10; | 725 | delta = ktime_sub(rettime, calltime); |
726 | ret.duration = (unsigned long long) delta.tv64 >> 10; | ||
727 | trace_boot_ret(&ret, fn); | ||
722 | printk("initcall %pF returned %d after %Ld usecs\n", fn, | 728 | printk("initcall %pF returned %d after %Ld usecs\n", fn, |
723 | it.result, it.duration); | 729 | ret.result, ret.duration); |
724 | trace_boot(&it, fn); | ||
725 | } | 730 | } |
726 | 731 | ||
727 | msgbuf[0] = 0; | 732 | msgbuf[0] = 0; |
728 | 733 | ||
729 | if (it.result && it.result != -ENODEV && initcall_debug) | 734 | if (ret.result && ret.result != -ENODEV && initcall_debug) |
730 | sprintf(msgbuf, "error code %d ", it.result); | 735 | sprintf(msgbuf, "error code %d ", ret.result); |
731 | 736 | ||
732 | if (preempt_count() != count) { | 737 | if (preempt_count() != count) { |
733 | strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); | 738 | strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); |
@@ -741,7 +746,7 @@ int do_one_initcall(initcall_t fn) | |||
741 | printk("initcall %pF returned with %s\n", fn, msgbuf); | 746 | printk("initcall %pF returned with %s\n", fn, msgbuf); |
742 | } | 747 | } |
743 | 748 | ||
744 | return it.result; | 749 | return ret.result; |
745 | } | 750 | } |
746 | 751 | ||
747 | 752 | ||
@@ -882,7 +887,7 @@ static int __init kernel_init(void * unused) | |||
882 | * we're essentially up and running. Get rid of the | 887 | * we're essentially up and running. Get rid of the |
883 | * initmem segments and start the user-mode stuff.. | 888 | * initmem segments and start the user-mode stuff.. |
884 | */ | 889 | */ |
885 | stop_boot_trace(); | 890 | |
886 | init_post(); | 891 | init_post(); |
887 | return 0; | 892 | return 0; |
888 | } | 893 | } |