libperfmon Tutorial: Direct Access to Counters and Clocks
The low-level interface in libperfmon provides direct access to the Pentium(R)
Pro processor and CNIC counters and clocks.
- eprofil() controls statistical sampling.
- getetimer() reads one of three interval timers (wall clock time,
time OS executes on behalf of process, or process execution time).
- gettsc() reads the time stamp counter (counts processor clock cycles).
- getglobalclock() reads the global clock which is synchronized
across all nodes to within 100 nsecs.
- setglobalalarm() and getglobalalarm() allow handler to
be setup for use with the global clock.
- getcniccounter() reads CNIC counters for monitoring memory bus
and message passing traffic.
- setperfevtsel() and getperfevtsel() define which processor
counters to monitor.
- setperfevthandler() and getperfevthandler() allow a
handler to be defined for processor counter overflow.
- startppcounters() and stoppppcounters() control when the
counters are counting.
- setppcounter() initializes the counter register.
getppcounter() reads the counter register.
Use the perfmonerror() call to print an error string if -1 (or -1.0)
is returned by any of these calls.
Refer to the Intel Pentium(R) Pro Family Developer's Manual for
information on all the available counters.