All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	mingo@elte.hu, Peter Zijlstra <a.p.zijlstra@chello.nl>,
	lenb@kernel.org
Subject: Re: PATCH] ftrace: Add a C/P state tracer to help power optimization
Date: Mon, 6 Oct 2008 13:57:15 -0700	[thread overview]
Message-ID: <20081006135715.6a52e954@infradead.org> (raw)
In-Reply-To: <87y711moz2.fsf@basil.nowhere.org>

On Mon, 06 Oct 2008 22:46:09 +0200
Andi Kleen <andi@firstfloor.org> wrote:
> >  
> > +	trace_power_mark(&it, POWER_PSTATE, next_perf_state);
> 
> Wouldn't that be better higher up in the cpufreq system?  It would
> seem bad to duplicate that in all low level cpufreq modules.

the problem is that higher up the actual P state isn't known.

> 
> Also I suspect some higher level format would be good here too.
> Just put the frequency in? 

the link between P states and frequency is... rather lose.
Especially with Turbo Mode it no longer is really relevant to list
frequencies.

> > +			ret = trace_seq_printf(s, "[%5ld.%09ld]
> > CSTATE: Going to C%i on cpu %i for %ld.%09ld\n",
> > +					  stamp.tv_sec,
> > +					  stamp.tv_nsec,
> > +					  it->state, iter->cpu,
> > +					  duration.tv_sec,
> > +					  duration.tv_nsec);
> > +		if (it->type == POWER_PSTATE)
> > +			ret = trace_seq_printf(s, "[%5ld.%09ld]
> > PSTATE: Going to P%i on cpu %i\n",
> > +					  stamp.tv_sec,
> > +					  stamp.tv_nsec,
> > +					  it->state, iter->cpu);
> 
> I suspect a less verbose output format would be better.
why?
It's fine as it is, and it's actually human readable as well.

> 
> > +{
> > +	if (!trace_power_enabled)
> > +		return;
> > +
> > +	memset(it, 0, sizeof(struct power_trace));
> 
> The memset seems redundant.

it's free and it initializes the datastructure cleanly; and only when
the tracer is in use.

> 

> Hmm, that does a unconditional wake_up() in idle. Doesn't this cause
> a loop on UP?
> 
> idle -> wakeup -> idle -> wakeup -> ... etc.
> 
> Am I missing something?

yes you're missing something ;-)
this code is called when going out of idle, not when going into idle.


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  reply	other threads:[~2008-10-06 20:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-06 17:26 PATCH] ftrace: Add a C/P state tracer to help power optimization Arjan van de Ven
2008-10-06 20:46 ` Andi Kleen
2008-10-06 20:57   ` Arjan van de Ven [this message]
2008-10-06 21:19     ` Andi Kleen
2008-10-06 21:21       ` Arjan van de Ven
2008-10-06 21:34         ` Andi Kleen
2008-10-07 10:39   ` Steven Rostedt
2008-10-27 15:59 ` Ingo Molnar
2008-10-27 16:05   ` Steven Rostedt
2008-10-27 16:21     ` Alan Cox
2008-10-27 17:16       ` Steven Rostedt
2008-10-27 18:05   ` Arjan van de Ven
2008-10-27 19:47     ` Frank Ch. Eigler
2008-10-27 20:13       ` Steven Rostedt
2008-10-27 21:06       ` Arjan van de Ven
2008-10-28 10:04         ` Ingo Molnar
2009-02-10 20:57         ` Jason Baron
2009-02-10 21:26           ` Frederic Weisbecker
2009-02-11  9:30           ` Ingo Molnar
2009-02-11 18:57             ` Jason Baron

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=20081006135715.6a52e954@infradead.org \
    --to=arjan@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andi@firstfloor.org \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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.