Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f0c45cdf87dc9141e87b0ad2fc6fff216a95f79
Commit:     8f0c45cdf87dc9141e87b0ad2fc6fff216a95f79
Parent:     b73a7e76c1eeaa770a41554698917c3c45686a07
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:28:26 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:07 2007 -0700

    enhance initcall_debug, measure latency
    
    enhance the initcall_debug boot option:
    
     - measure the time the initcall took to execute and report
       it in units of milliseconds.
    
     - show the return code of initcalls (useful to see failures and
       to make sure that an initcall hung)
    
    [EMAIL PROTECTED]: fix printk warning]
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 init/main.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/init/main.c b/init/main.c
index 949c27b..c1537e0 100644
--- a/init/main.c
+++ b/init/main.c
@@ -648,6 +648,7 @@ static void __init do_initcalls(void)
        int count = preempt_count();
 
        for (call = __initcall_start; call < __initcall_end; call++) {
+               ktime_t t0, t1, delta;
                char *msg = NULL;
                char msgbuf[40];
                int result;
@@ -657,10 +658,26 @@ static void __init do_initcalls(void)
                        print_fn_descriptor_symbol(": %s()",
                                        (unsigned long) *call);
                        printk("\n");
+                       t0 = ktime_get();
                }
 
                result = (*call)();
 
+               if (initcall_debug) {
+                       t1 = ktime_get();
+                       delta = ktime_sub(t1, t0);
+
+                       printk("initcall 0x%p", *call);
+                       print_fn_descriptor_symbol(": %s()",
+                                       (unsigned long) *call);
+                       printk(" returned %d.\n", result);
+
+                       printk("initcall 0x%p ran for %Ld msecs: ",
+                               *call, (unsigned long long)delta.tv64 >> 20);
+                       print_fn_descriptor_symbol("%s()\n",
+                               (unsigned long) *call);
+               }
+
                if (result && result != -ENODEV && initcall_debug) {
                        sprintf(msgbuf, "error code %d", result);
                        msg = msgbuf;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to