public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Hitoshi Mitake" <mitake@dcl.info.waseda.ac.jp>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>
Cc: Dominik Brodowski <linux@brodo.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC] Adding transition of CPU frequency counting support to perfcounters
Date: Sat, 18 Jul 2009 11:31:15 +0200	[thread overview]
Message-ID: <20090718093115.GB9142@elte.hu> (raw)
In-Reply-To: <20090716.110834.886429911292889318.mitake@dcl.info.waseda.ac.jp>


* Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> wrote:

> Hi,
> 
> I'm trying to add transition of CPU frequency counting support to perfcounters.
> If perf can count freq transition, this will be more useful
> because frequencies of CPUs are dynamic things today.
> And there's no way to count freq transitions per process level.
> 
> But I have a question.
> I copied the way of sw-events already exist such as migration or page-fault.
> But like this,
> 
> % perf stat emacs
> 
>  Performance counter stats for 'emacs':
> 
>     1324.294227  task-clock-msecs         #      0.704 CPUs
>            1980  context-switches         #      0.001 M/sec
>              30  CPU-migrations           #      0.000 M/sec
>           42986  page-faults              #      0.032 M/sec
>               0  cpufreq-up               #      0.000 M/sec
>                  ^^^^^^^^^^
>               0  cpufreq-down             #      0.000 M/sec
>                  ^^^^^^^^^^^^      
>      4057387374  cycles                   #   3063.811 M/sec
>      4767004447  instructions             #      1.175 IPC
>        20687483  cache-references         #     15.622 M/sec
>         5103528  cache-misses             #      3.854 M/sec
> 
>     1.880587959  seconds time elapsed
> 
> perf said there's no freq transition.
> But I checked there are some transitions with cpufreq-info.
> 
> Can you find something bad in this patch?
> I'll continue to try implementing.
> If you find some bad points, I'd like to hear..

> +		if (freqs->new > freqs->old)
> +			perf_swcounter_event(PERF_COUNT_SW_CPUFREQ_UP,
> +					     1, 0, NULL, 0);
> +		else
> +			perf_swcounter_event(PERF_COUNT_SW_CPUFREQ_DOWN,
> +					     1, 0, NULL, 0);

Could you try:

	perf stat -a sleep 60

while you do your emacs run that toggles cpufreq events? This makes 
sure all transitions are counted, regardless of which context 
triggers it. Do you still get zero counts this way?

	Ingo

  reply	other threads:[~2009-07-18  9:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16  2:08 [PATCH][RFC] Adding transition of CPU frequency counting support to perfcounters Hitoshi Mitake
2009-07-18  9:31 ` Ingo Molnar [this message]
2009-07-18 14:11   ` mitake
2009-07-18 16:09     ` Peter Zijlstra
2009-07-21  1:46       ` Hitoshi Mitake
2009-08-02 20:13         ` 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=20090718093115.GB9142@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@brodo.de \
    --cc=mitake@dcl.info.waseda.ac.jp \
    /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