From: David Ahern <dsahern@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: perf: h/w counters not counted and no error/info reported to user
Date: Fri, 27 May 2011 09:04:35 -0600 [thread overview]
Message-ID: <4DDFBD83.3020105@gmail.com> (raw)
In-Reply-To: <20110527095036.GK21386@elte.hu>
On 05/27/2011 03:50 AM, Ingo Molnar wrote:
>
> * David Ahern <dsahern@gmail.com> wrote:
>
>> By default (tip-perf-core) perf-stat enables a number of H/W counters:
>>
>> perf stat -- sleep 1
>
> did you mean to do 'perf stat -a sleep 1' ?
Adding the -a has its own problems. It blocks reading from fd=0 (stdin);
I have to type Ctrl-D to see the results. The FD array gets initialized
to 0 and some case is not erroring out or setting the fd.
perf stat -a -- sleep 1
Performance counter stats for 'sleep 1':
2008.600377 task-clock
545 context-switches
31 CPU-migrations
198 page-faults
101,938,898 cycles
140,734,186,560,480 stalled-cycles-frontend
0 stalled-cycles-backend
115,406,129 instructions
26,361,321 branches
1,068,804 branch-misses
1.003842524 seconds time elapsed
The stalled-cycles-frontend is off the chats, but shows a value.
Similarly, backed shows 0 versus <not counted>.
>
> 'perf stat sleep 1' in itself will only measure that very simple
> command - which does not do much.
Simple program for a simple test. I just wanted to know which counters
are available for a given processor.
Per your comment and Corey's I tried a program that does some work:
perf stat -- openssl speed aes
Performance counter stats for 'openssl speed aes':
44964.148608 task-clock
4,593 context-switches
48 CPU-migrations
487 page-faults
124,134,470,217 cycles
<not counted> stalled-cycles-frontend
<not counted> stalled-cycles-backend
319,440,401,206 instructions
6,710,107,937 branches
1,638,412 branch-misses
45.012092601 seconds time elapsed
This time I get data for 4 events -- which I did not get with sleep --
but I get <not counted> for the stalled cycles.
How is the <not counted> supposed to be interpreted?
Also, back to the 'perf stat -- sleep 1' example: If I run it with
individual -e <event> args I get values -- up to 3. Sure sleep is a
simple program, but some counter value comes out. What's magical about 3?
David
>
> Thanks,
>
> Ingo
next prev parent reply other threads:[~2011-05-27 15:04 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
2011-05-27 9:50 ` Ingo Molnar
2011-05-27 15:04 ` David Ahern [this message]
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=4DDFBD83.3020105@gmail.com \
--to=dsahern@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--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