From: Corey Ashford <cjashfor@linux.vnet.ibm.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>,
paulus@au1.ibm.com, LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>
Subject: perf_events: zero time running and enabled, but non-zero count
Date: Fri, 23 Oct 2009 12:16:18 -0700 [thread overview]
Message-ID: <4AE20102.8010002@linux.vnet.ibm.com> (raw)
Hi folks,
First let me state that I'm working with a Linux kernel which is a couple of
weeks old and came from Linus' post-2.6.31 release tree. It does contain the
name change from perf_counter to perf_event, for example.
I'm working on some optimizations of PAPI's use of perf_events. In particular I
want to speed up the reading of events. To do this, I am doing two things:
1) Not disabling and enabling the counters around reading the counters. In
other words, read them on the fly.
2) Use the PERF_FORMAT_GROUP option so that I can read up an entire group of
counters in one syscall.
This seems to be working fairly well, except it seems that sometimes the "time
running" and "time enabled" values that I read up are zero, even though the
count is non-zero. The case I'm looking at has three groups, and it's the third
group, containing a single event, which is getting the zero enabled/running values.
One experiment that I just now tried was to put the code back in that
disables/re-enables the counters around the code that reads the counters. This
seems to have fixed the problem, but causes a performance degradation, of course.
Is this expected behavior? Should I be able to read the counts, and times on
the fly like I want to be able to do?
Thanks for your consideration of this issue.
- Corey
Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
Beaverton, OR
cjashfor@us.ibm.com
next reply other threads:[~2009-10-23 19:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-23 19:16 Corey Ashford [this message]
[not found] ` <20091023193246.GA3139@elte.hu>
[not found] ` <4AE21655.6040403@linux.vnet.ibm.com>
2009-10-23 20:57 ` perf_events: zero time running and enabled, but non-zero count Ingo Molnar
2009-10-26 2:37 ` Corey Ashford
2009-10-30 0:13 ` Corey Ashford
2009-11-02 21:20 ` Frederic Weisbecker
2009-11-03 0:27 ` Corey Ashford
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=4AE20102.8010002@linux.vnet.ibm.com \
--to=cjashfor@linux.vnet.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@au1.ibm.com \
/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