From: David Ahern <dsahern@gmail.com>
To: Ingo Molnar <mingo@elte.hu>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: perf: h/w counters not counted and no error/info reported to user
Date: Thu, 26 May 2011 16:10:16 -0600 [thread overview]
Message-ID: <4DDECFC8.7090903@gmail.com> (raw)
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
Based on that I am guessing that only the last N requested events are
counted where N is processor specific. In my case N is apparently 3 as
this works:
perf stat -e cycles -e instructions -e branches -- sleep 1
Performance counter stats for 'sleep 1':
1,028,331 cycles
634,101 instructions
130,253 branches
but adding a fourth causes the first one to roll off -- again without
any message from perf:
perf stat -e cycles -e instructions -e branches -e branch-misses -v --
sleep 1
Performance counter stats for 'sleep 1':
<not counted> cycles
219,727 instructions
128,071 branches
6,625 branch-misses
Which is confusing -- cycles are not counted, yet it should be given
that it is supported.
David
next reply other threads:[~2011-05-26 22:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-26 22:10 David Ahern [this message]
2011-05-27 6:31 ` perf: h/w counters not counted and no error/info reported to user Corey Ashford
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=4DDECFC8.7090903@gmail.com \
--to=dsahern@gmail.com \
--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