From: Mihai-Dan Budiu <mihaib@strudel.act-r.cs.cmu.edu>
Subject: cycle counter register
Date: 08 Jan 2001 23:16:38 -0500 [thread overview]
Message-ID: <uijk885uzq1.fsf@strudel.act-r.cs.cmu.edu> (raw)
Hello.
I am sorry if this is not the right forum; I could not find many
newsgroups related to Alpha.
I am trying to get some performance measurements for programs running
on Alpha. What I would like to do is to count the execution time of a
program EXCEPT in a few portions of code. I have the source code of
the programs I am measuring. I am interested in being as much
"cycle-accurate" as possible. I am using 'gcc -O4'.
I have tried to use ATOM, but it is too heavyweight: the code I am
measuring is executed often, and the overhead of inserting procedure
calls is too big (1000%).
Now I have resorted to inserting just a few instructions to read the
cycle counter register (using rpcc), and to make simple computations
with it. I get the counters before and after the code I want to skip,
and I accumulate only the time spent outside this code.
My programs don't run too much, so the counters don't overflow.
However, I encounter two problems with this approach:
1) the results vary from measurement to measurement, even on an
unloaded system (around 10% variance I would say).
2) I believe that the compiler and the OOO execution actually reorder
my instrumentation code, and thus I am not really measuring what I
want.
My questions are:
a) is there a method to measure in a very lightweight fashion just the
user-level runtime of a process? should I expect for such a value
a variance of an order >10%, due to the unpredictable scheduling on
OS and application code on the CPU?
b) is there a way to avoid the reordering of the instrumentation
instructions, without incurring a big overhead (i.e. >10%)?
c) is there some documentation with guidelines on how to carry such
measurements on Alphas (or perhaps any other Unix system)?
Thank you very much for any hint.
Mihai Budiu
next reply other threads:[~2001-01-09 4:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-09 4:16 Mihai-Dan Budiu [this message]
2001-01-11 2:34 ` cycle counter register Jeffrey Mogul
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox