linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Marc Titinger <mtitinger@baylibre.com>
Cc: khilman@kernel.org, rjw@rjwysocki.net,
	linux-omap@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/2] Trace: PM: promote event 'power_domain_target' to generic power domains.
Date: Fri, 25 Sep 2015 10:05:32 -0400	[thread overview]
Message-ID: <20150925100532.7cf5bde7@gandalf.local.home> (raw)
In-Reply-To: <1443187345-14834-2-git-send-email-mtitinger+renesas@baylibre.com>

On Fri, 25 Sep 2015 15:22:24 +0200
Marc Titinger <mtitinger@baylibre.com> wrote:

> From: Marc Titinger <mtitinger@baylibre.com>
> 
> - change arg3 to a state name string: we got the current CPU rom the trace
> backend already. This also prepares for multiple/named states in the power
> domain, consistent with idle-states. states in the domain may match given
> CPU states in this case, we will trace them by their name, and potentially
> use arg2 as a link to their index for the cpuidle driver.
> 
> - tested with Juno DP
> 
> <idle>-0     [000]    42.395510: power_domain_target:  a53_pd index=0 'cluster-sleep-0'
> <idle>-0     [000]    42.395528: cpu_idle:             state=4294967295 cpu_id=0
> <idle>-0     [000]    42.395668: cpu_idle:             state=2 cpu_id=0
> 
> - compiled for Omap2+
> 
> Signed-off-by: Marc Titinger <mtitinger@baylibre.com>
> ---
>  drivers/base/power/domain.c  |  9 +++++++++
>  include/trace/events/power.h | 29 +++++++++++++++--------------
>  2 files changed, 24 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 59ccd92..b9e2a37 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -21,6 +21,10 @@
>  #include <linux/export.h>
>  #include <linux/sort.h>
>  
> +#ifdef CONFIG_PM_ADVANCED_DEBUG
> +#include <trace/events/power.h>
> +#endif

Are the events in events/power.h only available when PM_ADVANCED_DEBUG
is enabled? If so, this should probably be encapsulated in that header
file, with an "#else" that makes all the trace_power_*() calls into
static inlined nops. Then you can get rid of the ugly #ifdef in this
file.


> +
>  #define GENPD_RETRY_MAX_MS	250		/* Approximate */
>  
>  #define GENPD_DEV_CALLBACK(genpd, type, callback, dev)		\
> @@ -328,6 +332,11 @@ static int __pm_genpd_poweron(struct generic_pm_domain *genpd)
>  
>   out:
>  	genpd->status = GPD_STATE_ACTIVE;
> +
> +#ifdef CONFIG_PM_ADVANCED_DEBUG
> +	trace_power_domain_target(genpd->name, genpd->state_idx,
> +				genpd->states[genpd->state_idx].name);
> +#endif
>  	return 0;
>  
>   err:
> diff --git a/include/trace/events/power.h b/include/trace/events/power.h
> index 284244e..8f93be6 100644
> --- a/include/trace/events/power.h
> +++ b/include/trace/events/power.h
> @@ -237,9 +237,9 @@ DECLARE_EVENT_CLASS(clock,
>  	TP_ARGS(name, state, cpu_id),
>  
>  	TP_STRUCT__entry(
> -		__string(       name,           name            )
> -		__field(        u64,            state           )
> -		__field(        u64,            cpu_id          )
> +		__string(name, name)
> +		__field(u64, state)
> +		__field(u64, cpu_id)

Note, the standard formatting for the tracepoints is with the spaces.
Igonre checkpatch for that, tracepoints don't follow it.

-- Steve

>  	),
>  
>  	TP_fast_assign(
> @@ -278,31 +278,32 @@ DEFINE_EVENT(clock, clock_set_rate,
>   */
>  DECLARE_EVENT_CLASS(power_domain,


  reply	other threads:[~2015-09-25 14:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 13:22 [PATCH 0/2] Trace: PM: promote event 'power_domain_target' to generic power domains Marc Titinger
2015-09-25 13:22 ` [PATCH 1/2] " Marc Titinger
2015-09-25 14:05   ` Steven Rostedt [this message]
2015-09-28  8:44   ` [PATCH v2 " Marc Titinger
2015-09-28  8:44   ` [PATCH v2 2/2] arm: omap2+: PM: change trace_power_domain_target event format Marc Titinger
2015-09-28 13:20     ` [PATCH v3 1/2] Trace: PM: promote event 'power_domain_target' to generic power domains Marc Titinger
2015-09-28 13:31       ` kbuild test robot
2015-10-14  0:55       ` Rafael J. Wysocki
2015-10-14  8:18         ` Marc Titinger
2015-10-14 16:49           ` Rafael J. Wysocki
2015-09-28 13:20     ` [PATCH v3 2/2] arm: omap2+: PM: change trace_power_domain_target event format Marc Titinger
2015-09-25 13:22 ` [PATCH " Marc Titinger
2015-09-25 14:10   ` Steven Rostedt
2015-09-25 14:57     ` Marc Titinger
2015-10-12 23:33       ` Tony Lindgren
2015-10-13  7:59         ` Marc Titinger

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=20150925100532.7cf5bde7@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=khilman@kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mtitinger@baylibre.com \
    --cc=rjw@rjwysocki.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).