All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Sameer Nanda <snanda@chromium.org>
Cc: rob@landley.net, len.brown@intel.com, pavel@ucw.cz, rjw@sisk.pl,
	rostedt@goodmis.org, fweisbec@gmail.com, mingo@redhat.com,
	jkosina@suse.cz, standby24x7@gmail.com, jj@chaosbits.net,
	paulmck@linux.vnet.ibm.com, josh@joshtriplett.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] power, trace: add tracing for device_resume
Date: Fri, 18 May 2012 11:37:56 -0700	[thread overview]
Message-ID: <20120518183756.GA3216@kroah.com> (raw)
In-Reply-To: <1337365643-29261-1-git-send-email-snanda@chromium.org>

On Fri, May 18, 2012 at 11:27:23AM -0700, Sameer Nanda wrote:
> Added event tracing for device_resume. This helps quickly pinpoint which
> devices take a long time to resume.
> 
> Signed-off-by: Sameer Nanda <snanda@chromium.org>
> ---
>  Documentation/trace/events-power.txt |   20 +++++++++++
>  drivers/base/power/main.c            |   10 ++++++
>  include/trace/events/power.h         |   59 ++++++++++++++++++++++++++++++++++
>  3 files changed, 89 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt
> index cf794af..dbfb7f0 100644
> --- a/Documentation/trace/events-power.txt
> +++ b/Documentation/trace/events-power.txt
> @@ -88,3 +88,23 @@ power_domain_target	"%s state=%lu cpu_id=%lu"
>  The first parameter gives the power domain name (e.g. "mpu_pwrdm").
>  The second parameter is the power domain target state.
>  
> +4. Device resume events
> +=======================
> +The device resume events are used for measuring the time taken to resume
> +devices.
> +
> +device_resume_in	"device=%s driver=%s"
> +device_resume_waited	"device=%s driver=%s time_delta=%lld"
> +device_resume_out	"device=%s driver=%s time_delta=%lld"
> +
> +The first parameter is the device that is being resumed.
> +
> +The second parameter is the driver associated with the device being resumed.
> +
> +The third parameter in device_resume_waited is the time delta from the entry
> +point of device_resume to the wait completion of parent device being resumed.
> +The unit for time_delta is us.
> +
> +The third parameter in device_resume_out is the time delta from the wait
> +completion of parent device being resumed to device_resume being completed.
> +The unit for time_delta is us.
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index b462c0e..3ed01cd 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -28,6 +28,7 @@
>  #include <linux/sched.h>
>  #include <linux/async.h>
>  #include <linux/suspend.h>
> +#include <trace/events/power.h>
>  
>  #include "../base.h"
>  #include "power.h"
> @@ -565,11 +566,19 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
>  	char *info = NULL;
>  	int error = 0;
>  	bool put = false;
> +	s64 in_time = ktime_to_us(ktime_get());
> +	s64 wait_done_time;
> +
> +	trace_device_resume_in(dev);
>  
>  	TRACE_DEVICE(dev);
>  	TRACE_RESUME(0);

Don't these TRACE_DEVICE() and TRACE_RESUME() calls already provide you
the same information you are wanting to determine above if you look at
the timestamps of the events?  Can you not do time processing in
userspace?

confused,

greg k-h

  reply	other threads:[~2012-05-18 18:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 18:27 [PATCH] power, trace: add tracing for device_resume Sameer Nanda
2012-05-18 18:37 ` Greg KH [this message]
2012-05-18 18:57   ` Sameer Nanda
2012-05-18 19:14     ` Steven Rostedt
2012-05-18 20:58       ` Sameer Nanda
2012-05-18 21:19         ` Steven Rostedt
2012-05-18 21:39           ` Sameer Nanda
2012-05-18 21:46             ` Rafael J. Wysocki
2012-05-18 22:17               ` Sameer Nanda
2012-05-18 23:01                 ` Greg KH
2012-05-18 23:15                   ` Sameer Nanda
2012-05-19 11:59                     ` Rafael J. Wysocki
2012-05-19 16:32                       ` Greg KH
2012-05-19 19:30                         ` Rafael J. Wysocki
2012-05-22 19:18                           ` Sameer Nanda
2012-05-19  0:24                   ` Steven Rostedt
2012-05-18 21:27 ` Rafael J. Wysocki
2012-05-22 19:16 ` [PATCH] power: add knob for printing device resume times Sameer Nanda
2012-05-22 20:24   ` Greg KH
2012-05-23 16:45     ` [PATCH v2] " Sameer Nanda
2012-06-04 22:41       ` Sameer Nanda
2012-06-05  6:26         ` Greg KH
2012-06-10 11:25         ` Pavel Machek
2012-06-15  0:19       ` Greg KH
2012-06-15 10:00         ` Rafael J. Wysocki
2012-06-15 14:09           ` Greg KH
2012-06-16 13:57             ` Rafael J. Wysocki
2012-06-16 20:36               ` [PATCH] (was: Re: [PATCH v2] power: add knob for printing device resume times) Rafael J. Wysocki
2012-06-18  1:26                 ` Greg KH
2012-06-18  5:45                 ` Srivatsa S. Bhat
2012-06-28 21:29                   ` Sameer Nanda
2012-08-16 14:03               ` [PATCH v2] power: add knob for printing device resume times Pavel Machek
2012-05-24 10:27   ` [PATCH] " Pavel Machek
2012-05-29 17:08     ` Sameer Nanda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120518183756.GA3216@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=fweisbec@gmail.com \
    --cc=jj@chaosbits.net \
    --cc=jkosina@suse.cz \
    --cc=josh@joshtriplett.org \
    --cc=len.brown@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=rob@landley.net \
    --cc=rostedt@goodmis.org \
    --cc=snanda@chromium.org \
    --cc=standby24x7@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.