Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752805AbZLMCGh (ORCPT ); Sat, 12 Dec 2009 21:06:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S935390AbZLMCGG (ORCPT ); Sat, 12 Dec 2009 21:06:06 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:40490 "HELO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S935363AbZLMCF7 (ORCPT ); Sat, 12 Dec 2009 21:05:59 -0500 From: "Rafael J. Wysocki" To: Arjan van de Ven Subject: Re: [PATCH] suspend: add initcall_debug style timing for suspend/resume Date: Sat, 12 Dec 2009 19:29:06 +0100 User-Agent: KMail/1.12.3 (Linux/2.6.32-rjw; KDE/4.3.3; x86_64; ; ) Cc: Linus Torvalds , LKML , ACPI Devel Maling List , pm list , Alan Stern References: <20091206123552.7be316b2@infradead.org> <200912121927.55186.rjw@sisk.pl> In-Reply-To: <200912121927.55186.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912121929.06330.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2581 Lines: 70 On Saturday 12 December 2009, Rafael J. Wysocki wrote: > On Sunday 06 December 2009, Arjan van de Ven wrote: > > > > From fcd52b97aa02f19baa570e4a62dfdfab0faed976 Mon Sep 17 00:00:00 2001 > > From: Arjan van de Ven > > Date: Sun, 6 Dec 2009 12:32:28 -0800 > > Subject: [PATCH] suspend: add initcall_debug style timing for suspend/resume > > > > In order to diagnose overall suspend/resume times, we need > > basic instrumentation to break down the total time into per > > device timing, similar to initcall_debug. > > > > This patch adds the basic timing instrumentation, needed > > for a scritps/bootgraph.pl equivalent or humans. > > The bootgraph.pl program is still a work in progress, but > > is far enough along to know that this patch is sufficient. > > > > Signed-off-by: Arjan van de Ven > > --- > > drivers/base/power/main.c | 29 +++++++++++++++++++++++++++++ > > include/linux/init.h | 2 ++ > > 2 files changed, 31 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c > > index 8aa2443..2ad345c 100644 > > --- a/drivers/base/power/main.c > > +++ b/drivers/base/power/main.c > > @@ -25,6 +25,7 @@ > > #include > > #include > > #include > > +#include > > > > #include "../base.h" > > #include "power.h" > > @@ -172,6 +173,12 @@ static int pm_op(struct device *dev, > > pm_message_t state) > > { > > int error = 0; > > + ktime_t calltime, delta, rettime; > > + > > + if (initcall_debug) { > > + printk("calling %s+ @ %i\n", dev_name(dev), task_pid_nr(current)); > > + calltime = ktime_get(); > > + } > > > > switch (state.event) { > > #ifdef CONFIG_SUSPEND > > @@ -219,6 +226,14 @@ static int pm_op(struct device *dev, > > default: > > error = -EINVAL; > > } > > + > > + if (initcall_debug) { > > + rettime = ktime_get(); > > + delta = ktime_sub(rettime, calltime); > > + printk("initcall %s+ returned %d after %Ld usecs\n", dev_name(dev), > > + error, (unsigned long long) ktime_to_ns(delta) >> 10); > > I've changed that "initcall" to "call". Hopefully that won't break your scripts. ;-) In addition to that I've changed printk to pr_infor everywhere in the patch, is that fine with you? Rafael -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/