All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Titinger <mtitinger@baylibre.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: khilman@kernel.org, rjw@rjwysocki.net,
	linux-omap@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 2/2] arm: omap2+: PM: change trace_power_domain_target event format.
Date: Fri, 25 Sep 2015 16:57:49 +0200	[thread overview]
Message-ID: <560560ED.5000803@baylibre.com> (raw)
In-Reply-To: <20150925101025.6b3862bf@gandalf.local.home>



On 25/09/2015 16:10, Steven Rostedt wrote:
> On Fri, 25 Sep 2015 15:22:25 +0200
> Marc Titinger <mtitinger@baylibre.com> wrote:
>
>> From: Marc Titinger <mtitinger@baylibre.com>
>>
>> power_domain_target arg3 is now a string (event name) with generic power
>> domains. In the case of Omap, it is a hint to the prev/next switch op.
>> Incidentally this trace is now conditioned by CONFIG_PM_ADVANCED_DEBUG.
> I'm curious to why the addition of this config option?
>
I meant to be consistent with Juno/generic-power-domains, so that this 
trace always (or never) requires this switch.
I think I will remove this condition for both actually.

>> Compiled for Omap2+ but not tested.
>>
>> Signed-off-by: Marc Titinger <mtitinger@baylibre.com>
>> ---
>>   arch/arm/mach-omap2/powerdomain.c | 32 ++++++++++++++++++++------------
>>   1 file changed, 20 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
>> index 78af6d8..cd77696 100644
>> --- a/arch/arm/mach-omap2/powerdomain.c
>> +++ b/arch/arm/mach-omap2/powerdomain.c
>> @@ -160,7 +160,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
>>   static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>>   {
>>   
>> -	int prev, next, state, trace_state = 0;
>> +	int prev, state;
>>   
>>   	if (pwrdm == NULL)
>>   		return -EINVAL;
>> @@ -177,18 +177,25 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>>   			pwrdm->state_counter[prev]++;
>>   		if (prev == PWRDM_POWER_RET)
>>   			_update_logic_membank_counters(pwrdm);
>> -		/*
>> -		 * If the power domain did not hit the desired state,
>> -		 * generate a trace event with both the desired and hit states
>> -		 */
>> -		next = pwrdm_read_next_pwrst(pwrdm);
>> -		if (next != prev) {
>> -			trace_state = (PWRDM_TRACE_STATES_FLAG |
>> +
>> +#ifdef CONFIG_PM_ADVANCED_DEBUG
> You do realize that you can add this to the block:
>
>
> 	if (trace_power_domain_target_enabled()) {
Nope I didn't, but now I do ;) thanks.

Marc.

>
> as it seems this code is only run to pass data to the tracepoint. The
> above if statement will keep this block in the 'out-of-line' path when
> tracing is not enabled via a static_key (jump-label).
>
> -- Steve
>
>> +		{
>> +			/*
>> +			 * If the power domain did not hit the desired state,
>> +			 * generate a trace event with both the desired and hit
>> +			 * states */
>> +			int next = pwrdm_read_next_pwrst(pwrdm);
>> +
>> +			if (next != prev) {
>> +				int trace_state = (PWRDM_TRACE_STATES_FLAG |
>>   				       ((next & OMAP_POWERSTATE_MASK) << 8) |
>>   				       ((prev & OMAP_POWERSTATE_MASK) << 0));
>> -			trace_power_domain_target(pwrdm->name, trace_state,
>> -						  smp_processor_id());
>> +				trace_power_domain_target(pwrdm->name,
>> +					trace_state, "PWRDM_STATE_PREV");
>> +			}
>>   		}
>> +#endif
>> +
>>   		break;
>>   	default:
>>   		return -EINVAL;
>> @@ -522,9 +529,10 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
>>   		 pwrdm->name, pwrst);
>>   
>>   	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
>> +#ifdef CONFIG_PM_ADVANCED_DEBUG
>>   		/* Trace the pwrdm desired target state */
>> -		trace_power_domain_target(pwrdm->name, pwrst,
>> -					  smp_processor_id());
>> +		trace_power_domain_target(pwrdm->name, pwrst, "set_next_pwrst");
>> +#endif
>>   		/* Program the pwrdm desired target state */
>>   		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
>>   	}


  reply	other threads:[~2015-09-25 14:57 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
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 [this message]
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=560560ED.5000803@baylibre.com \
    --to=mtitinger@baylibre.com \
    --cc=khilman@kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rostedt@goodmis.org \
    /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.