Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca538f6b authored by Tim Bird's avatar Tim Bird Committed by Ingo Molnar
Browse files

tracing/fastboot: add better resolution to initcall debug/tracing



Change the time resolution for initcall_debug to microseconds, from
milliseconds.  This is handy to determine which initcalls you want to work
on for faster booting.

One one of my test machines, over 90% of the initcalls are less than a
millisecond and (without this patch) these are all reported as 0 msecs.
Working on the 900 us ones is more important than the 4 us ones.

With 'quiet' on the kernel command line, this adds no significant overhead
to kernel boot time.

Signed-off-by: default avatarTim Bird <tim.bird@am.sony.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent ad0a3b68
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -217,7 +217,7 @@ struct boot_trace {
	pid_t			caller;
	pid_t			caller;
	char			func[KSYM_NAME_LEN];
	char			func[KSYM_NAME_LEN];
	int			result;
	int			result;
	unsigned long long	duration;
	unsigned long long	duration;		/* usecs */
	ktime_t			calltime;
	ktime_t			calltime;
	ktime_t			rettime;
	ktime_t			rettime;
};
};
+2 −2
Original line number Original line Diff line number Diff line
@@ -721,8 +721,8 @@ int do_one_initcall(initcall_t fn)
	if (initcall_debug) {
	if (initcall_debug) {
		it.rettime = ktime_get();
		it.rettime = ktime_get();
		delta = ktime_sub(it.rettime, it.calltime);
		delta = ktime_sub(it.rettime, it.calltime);
		it.duration = (unsigned long long) delta.tv64 >> 20;
		it.duration = (unsigned long long) delta.tv64 >> 10;
		printk("initcall %pF returned %d after %Ld msecs\n", fn,
		printk("initcall %pF returned %d after %Ld usecs\n", fn,
			it.result, it.duration);
			it.result, it.duration);
		trace_boot(&it, fn);
		trace_boot(&it, fn);
	}
	}