public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corey Ashford <cjashfor@linux.vnet.ibm.com>
To: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: perf: h/w counters not counted and no error/info reported to user
Date: Thu, 26 May 2011 23:31:44 -0700	[thread overview]
Message-ID: <4DDF4550.6060904@linux.vnet.ibm.com> (raw)
In-Reply-To: <4DDECFC8.7090903@gmail.com>

On 05/26/2011 03:10 PM, David Ahern wrote:
>
> By default (tip-perf-core) perf-stat enables a number of H/W counters:
>
> perf stat  -- sleep 1
>
> Performance counter stats for 'sleep 1':
>
>       1.346889 task-clock
>              1 context-switches
>              0 CPU-migrations
>            157 page-faults
> <not counted>  cycles
> <not counted>  stalled-cycles-frontend
> <not counted>  stalled-cycles-backend
>        493,740 instructions
>        137,062 branches
>          6,773 branch-misses
>
> In this case 3 of them are not counted and perf does not tell me why.
> I'm guessing that my processor (Core2 Duo T9550) does not support the
> stalled cycles counters. Should perf not emit a message telling me that?
>
> However, cycles is supported by the processor:
>
> perf stat -e cycles -- sleep 1
>
> Performance counter stats for 'sleep 1':
>
>           1,091,102 cycles

I suspect that what's happening is that "sleep 1" is not a very good 
test case, because it's sleeping most of the time.  The result is that 
some of the events don't have time enough to get counted because not 
enough system ticks occur while the "sleep 1" is running to get all of 
the events to be scheduled onto the PMU.

Try a simple problem which spins, or otherwise chews up cycles, for a 
second or so instead of sleeps.  I think you will get more events counted.

- Corey

  reply	other threads:[~2011-05-27  6:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26 22:10 perf: h/w counters not counted and no error/info reported to user David Ahern
2011-05-27  6:31 ` Corey Ashford [this message]
2011-05-27  9:50 ` Ingo Molnar
2011-05-27 15:04   ` David Ahern
2011-05-27 16:36     ` David Ahern
2011-05-30 21:04       ` Ashwin Chaugule
2011-05-31  0:41         ` David Ahern
2011-05-30  8:22     ` 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=4DDF4550.6060904@linux.vnet.ibm.com \
    --to=cjashfor@linux.vnet.ibm.com \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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