reading r10k counters via c++

reading r10k counters via c++

Post by Christopher Ost » Thu, 04 Jul 2002 03:10:01



Howdy all,

I'm currently examining performance issues in Immersive Graphics
environments, in particular an environment run on a SGI Onyx 2 with a
UNIX based OS (IRIX to be more precise).

At a low level I want to examine what is on each processor in the
machine at any given time, and the r10000 processors that are used in
this machine have built in hardware counters (registers that increment
at certain events).  Since those counters are universal though, all
events will be tracked, not just the ones from a given program.
However, there is an implementation of virtual counters that use
information from the hardware counters and can be tied to a given
process through /proc using ioctl.

I am having two problems currently.  

1. The program I am writing to keep track of all the data is not the
program I want to track. In order to initialize a virtual counter you
need to supply a pid, and the c function getpid() will return the pid
of the current process. I want to instead pass the pid of another
program.  I am looking for a good way to get the pid of said program
other than making a system call from the tracker with something like
"ps -ef | grep -i programname" then parsing out the pid. Any
suggestions? I was thinking of running from a script which could push
the pid into an environmental variable but still there would be issues
with calling order etc.

2. Many of the programs that run in the immersive environment aren't
simply multithreaded, but create multiple children.  I am interested
in the work the entire program is doing, not just the parent process.
Will tracking the parent also include the stats of the children? If
not, any ideas?

Thanks,
Christopher Oster
Penn State University

 
 
 

1. accessing r10k counters on SGI through c++

Howdy all,

I'm currently examining performance issues in Immersive Graphics
environments, in particular an environment run on a SGI Onyx 2 with a
UNIX based OS (IRIX to be more precise).

At a low level I want to examine what is on each processor in the
machine at any given time, and the r10000 processors that are used in
this machine have built in hardware counters (registers that increment
at certain events).  Since those counters are universal though, all
events will be tracked, not just the ones from a given program.
However, there is an implementation of virtual counters that use
information from the hardware counters and can be tied to a given
process through /proc using ioctl.

I am having two problems currently.  

1. The program I am writing to keep track of all the data is not the
program I want to track. In order to initialize a virtual counter you
need to supply a pid, and the c function getpid() will return the pid
of the current process. I want to instead pass the pid of another
program.  I am looking for a good way to get the pid of said program
other than making a system call from the tracker with something like
"ps -ef | grep -i programname" then parsing out the pid. Any
suggestions? I was thinking of running from a script which could push
the pid into an environmental variable but still there would be issues
with calling order etc.

2. Many of the programs that run in the immersive environment aren't
simply multithreaded, but create multiple children.  I am interested
in the work the entire program is doing, not just the parent process.
Will tracking the parent also include the stats of the children? If
not, any ideas?

Thanks,
Christopher Oster
Penn State University

2. Xshm -- help requested (and some help w/ XGrabPointer)

3. Reading the timestamp counter or other cycle counters on x86 Linux?

4. Screen area!

5. I need the (C/C++) source code of a CGI Counter that works, PLZ...

6. AOL + REMOTE_USER

7. how to read disk read & write i/o through a c/c++ program ?

8. realloc() fail in big memory array

9. performance counters 3.1 for 2.5.45 [2/4]: per-process counters

10. Apache and <!--#exec cgi="/cgi-bin/counter/counter.cgi" -->

11. x86 performance counters driver 3.0-pre2 for 2.5.44: [3/4] per-process counters

12. Accessing Ultra's performace counters and TICK counter

13. : adding counters to count bytes read/written