summaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2008-10-02 12:59:20 +0200
committerIngo Molnar <mingo@elte.hu>2008-10-14 10:39:11 +0200
commitcb5ab74204a6e2579d1119bf1348eb806526b12b (patch)
tree4810258d42e0370ec15cf424d5e3c6487fbd1781 /init/main.c
parent77ae11f63befb7fc41ec256f1fcb72ca7e4160d5 (diff)
downloadlinux-cb5ab74204a6e2579d1119bf1348eb806526b12b.tar.bz2
tracing/fastboot: change the printing of boot tracer according to bootgraph.pl
Change the boot tracer printing to make it parsable for the scripts/bootgraph.pl script. We have now to output two lines for each initcall, according to the printk in do_one_initcall() in init/main.c We need now the call's time and the return's time. 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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/init/main.c b/init/main.c
index 1e39a1eab190..61eb66159391 100644
--- a/init/main.c
+++ b/init/main.c
@@ -706,34 +706,32 @@ __setup("initcall_debug", initcall_debug_setup);
int do_one_initcall(initcall_t fn)
{
int count = preempt_count();
- ktime_t t0, t1, delta;
+ ktime_t delta;
char msgbuf[64];
- int result;
struct boot_trace it;
if (initcall_debug) {
it.caller = task_pid_nr(current);
it.func = fn;
printk("calling %pF @ %i\n", fn, it.caller);
- t0 = ktime_get();
+ it.calltime = ktime_get();
}
- result = fn();
+ it.result = fn();
if (initcall_debug) {
- t1 = ktime_get();
- delta = ktime_sub(t1, t0);
- it.result = result;
+ it.rettime = ktime_get();
+ delta = ktime_sub(it.rettime, it.calltime);
it.duration = (unsigned long long) delta.tv64 >> 20;
printk("initcall %pF returned %d after %Ld msecs\n", fn,
- result, it.duration);
+ it.result, it.duration);
trace_boot(&it);
}
msgbuf[0] = 0;
- if (result && result != -ENODEV && initcall_debug)
- sprintf(msgbuf, "error code %d ", result);
+ if (it.result && it.result != -ENODEV && initcall_debug)
+ sprintf(msgbuf, "error code %d ", it.result);
if (preempt_count() != count) {
strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -747,7 +745,7 @@ int do_one_initcall(initcall_t fn)
printk("initcall %pF returned with %s\n", fn, msgbuf);
}
- return result;
+ return it.result;
}