All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: "Robert Schöne" <robert.schoene@tu-dresden.de>
Cc: Arjan van de Ven <arjan@linux.intel.com>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Patch for tracing c states (power_end) on x86
Date: Wed, 24 Feb 2010 16:36:42 +0800	[thread overview]
Message-ID: <4B84E51A.900@cn.fujitsu.com> (raw)
In-Reply-To: <1266999573.3415.8.camel@localhost>

Robert Schöne wrote:
> Hello,
> 
> Since noone replied to my last mail (Febr. 15th, 11:42), describing the
> way to fix the missing c-state tracing, here's a patch.
> Maybe its easier that way.
> 
> (I used the perf-fixes-for-linus git tree to obtain a
> more-then-up-to-date version)
> 
> Bye Robert
> 
> 
> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
> index 02d6780..b1cfb88 100644
> --- a/arch/x86/kernel/process.c
> +++ b/arch/x86/kernel/process.c
> @@ -384,6 +384,7 @@ void default_idle(void)
>                 else
>                         local_irq_enable();
>                 current_thread_info()->status |= TS_POLLING;
> +               trace_power_end(1);
>         } else {
>                 local_irq_enable();
>                 /* loop is done by the caller */
> @@ -451,6 +452,7 @@ void mwait_idle_with_hints(unsigned long ax,
> unsigned long cx)
>                 if (!need_resched())
>                         __mwait(ax, cx);
>         }
> +       trace_power_end((ax>>4)+1);

The only argument of trace_power_end() is a dummy, so you can just
pass 0 or 1 to the trace hook, actually better pass 0 to be
consistent with other parts.

The dummy argument can't be eliminated, because the macros that
automatically generates racing code have some limitations, and
seems it's not so easy to get over.

>  }
>  
>  /* Default MONITOR/MWAIT with no hints, used for default C1 state */
> @@ -467,6 +469,7 @@ static void mwait_idle(void)
>                         __sti_mwait(0, 0);
>                 else
>                         local_irq_enable();
> +               trace_power_end(1);
>         } else
>                 local_irq_enable();
>  }
> 
> 

  reply	other threads:[~2010-02-24  8:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24  8:19 Patch for tracing c states (power_end) on x86 Robert Schöne
2010-02-24  8:36 ` Li Zefan [this message]
2010-02-24  8:44   ` Robert Schöne
2010-02-24  9:00     ` Li Zefan
2010-02-24  9:05       ` Robert Schöne
2010-02-25 12:52 ` Peter Zijlstra
2010-03-11  6:36   ` Robert Schöne
2010-03-11  8:12     ` Peter Zijlstra
2010-03-11 10:56       ` Ingo Molnar

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=4B84E51A.900@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=arjan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=robert.schoene@tu-dresden.de \
    --cc=tglx@linutronix.de \
    /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.