]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
tracing/fastboot: add better resolution to initcall debug/tracing
authorTim Bird <tim.bird@am.sony.com>
Thu, 9 Oct 2008 22:23:05 +0000 (15:23 -0700)
committerIngo Molnar <mingo@elte.hu>
Tue, 14 Oct 2008 08:39:27 +0000 (10:39 +0200)
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: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/ftrace.h
init/main.c

index 5812dba4ee249d2ef0a3bc19b2ab0b6fccdbf4ad..a3d46151be195cec1d701b7058ec98662860e65b 100644 (file)
@@ -215,9 +215,9 @@ ftrace_init_module(unsigned long *start, unsigned long *end) { }
 
 struct boot_trace {
        pid_t                   caller;
-       char                    func[KSYM_NAME_LEN];
+       char                    func[KSYM_NAME_LEN];
        int                     result;
-       unsigned long long      duration;
+       unsigned long long      duration;               /* usecs */
        ktime_t                 calltime;
        ktime_t                 rettime;
 };
index e7939de80f3eb515a3064b1e111bcaa9f87bbb84..b2e7ff4a5349fca67ff82a82f6c8167a7641f1e5 100644 (file)
@@ -721,8 +721,8 @@ int do_one_initcall(initcall_t fn)
        if (initcall_debug) {
                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,
+               it.duration = (unsigned long long) delta.tv64 >> 10;
+               printk("initcall %pF returned %d after %Ld usecs\n", fn,
                        it.result, it.duration);
                trace_boot(&it, fn);
        }