diff options
author | Frédéric Weisbecker <fweisbec@gmail.com> | 2008-09-23 06:38:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 04:38:50 -0400 |
commit | 3bf77af6e1fef1124bf71d81f9f84885f0ee0dea (patch) | |
tree | e16ac5f19fdcef2634a4ee5d5c10e9f31ee6df78 /init/main.c | |
parent | 1f5c2abbdeb2bb07b20c6a66bfecefe6c867b1ee (diff) |
tracing/ftrace: launch boot tracing after pre-smp initcalls
Launch the boot tracing inside the initcall_debug area. Old printk
have not been removed to keep the old way of initcall tracing for
backward compatibility.
[ mingo@elte.hu: resolved conflicts ]
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/init/main.c b/init/main.c index 16abba05c826..1e39a1eab190 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -709,10 +709,12 @@ int do_one_initcall(initcall_t fn) | |||
709 | ktime_t t0, t1, delta; | 709 | ktime_t t0, t1, delta; |
710 | char msgbuf[64]; | 710 | char msgbuf[64]; |
711 | int result; | 711 | int result; |
712 | struct boot_trace it; | ||
712 | 713 | ||
713 | if (initcall_debug) { | 714 | if (initcall_debug) { |
714 | printk("calling %pF", fn); | 715 | it.caller = task_pid_nr(current); |
715 | printk(" @ %i\n", task_pid_nr(current)); | 716 | it.func = fn; |
717 | printk("calling %pF @ %i\n", fn, it.caller); | ||
716 | t0 = ktime_get(); | 718 | t0 = ktime_get(); |
717 | } | 719 | } |
718 | 720 | ||
@@ -721,10 +723,11 @@ int do_one_initcall(initcall_t fn) | |||
721 | if (initcall_debug) { | 723 | if (initcall_debug) { |
722 | t1 = ktime_get(); | 724 | t1 = ktime_get(); |
723 | delta = ktime_sub(t1, t0); | 725 | delta = ktime_sub(t1, t0); |
724 | 726 | it.result = result; | |
725 | printk("initcall %pF returned %d after %Ld msecs\n", | 727 | it.duration = (unsigned long long) delta.tv64 >> 20; |
726 | fn, result, | 728 | printk("initcall %pF returned %d after %Ld msecs\n", fn, |
727 | (unsigned long long) delta.tv64 >> 20); | 729 | result, it.duration); |
730 | trace_boot(&it); | ||
728 | } | 731 | } |
729 | 732 | ||
730 | msgbuf[0] = 0; | 733 | msgbuf[0] = 0; |
@@ -859,6 +862,7 @@ static int __init kernel_init(void * unused) | |||
859 | smp_prepare_cpus(setup_max_cpus); | 862 | smp_prepare_cpus(setup_max_cpus); |
860 | 863 | ||
861 | do_pre_smp_initcalls(); | 864 | do_pre_smp_initcalls(); |
865 | start_boot_trace(); | ||
862 | 866 | ||
863 | smp_init(); | 867 | smp_init(); |
864 | sched_init_smp(); | 868 | sched_init_smp(); |