Skip to content

Commit 3bf77af

Browse files
fweisbecIngo Molnar
authored andcommitted
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. [ [email protected]: resolved conflicts ] Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 1f5c2ab commit 3bf77af

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

init/main.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -709,10 +709,12 @@ int do_one_initcall(initcall_t fn)
709709
ktime_t t0, t1, delta;
710710
char msgbuf[64];
711711
int result;
712+
struct boot_trace it;
712713

713714
if (initcall_debug) {
714-
printk("calling %pF", fn);
715-
printk(" @ %i\n", task_pid_nr(current));
715+
it.caller = task_pid_nr(current);
716+
it.func = fn;
717+
printk("calling %pF @ %i\n", fn, it.caller);
716718
t0 = ktime_get();
717719
}
718720

@@ -721,10 +723,11 @@ int do_one_initcall(initcall_t fn)
721723
if (initcall_debug) {
722724
t1 = ktime_get();
723725
delta = ktime_sub(t1, t0);
724-
725-
printk("initcall %pF returned %d after %Ld msecs\n",
726-
fn, result,
727-
(unsigned long long) delta.tv64 >> 20);
726+
it.result = result;
727+
it.duration = (unsigned long long) delta.tv64 >> 20;
728+
printk("initcall %pF returned %d after %Ld msecs\n", fn,
729+
result, it.duration);
730+
trace_boot(&it);
728731
}
729732

730733
msgbuf[0] = 0;
@@ -859,6 +862,7 @@ static int __init kernel_init(void * unused)
859862
smp_prepare_cpus(setup_max_cpus);
860863

861864
do_pre_smp_initcalls();
865+
start_boot_trace();
862866

863867
smp_init();
864868
sched_init_smp();

0 commit comments

Comments
 (0)