libperfmon Tutorial: Collecting Predefined Metrics
libperfmon contains a collection of high-level calls which make it
easy to collect commonly used performance data.
These calls come in
sets of three. To start data collection, insert a beginXXXX().
To stop data collection, insert an endXXXX().
Display the metric using printXXXX(). Replace the XXXX
with one of the following predefined metrics.
- mflops: Calculates number of floating point operations per
second using the global clock (sync'd across all nodes to within 100 nsecs).
- icache: Calculates instruction cache fetch (IFU) hit ratio.
- drefs: Counts data accesses (both read and write).
- dcachemiss: Counts data cache misses (both read and write).
- utilization: Counts data packets sent out over the mesh
- contention: Counts outbound data packet clashes on the mesh.
Use the perfmonerror() call to print an error string if -1 (or -1.0)
is returned by any of these calls.