Recording Hardware Performance Information (Linux* OS)
On Linux* OS Intel® Trace Collector can sample hardware counters with the Performance Application Programming Interface (PAPI). Because PAPI might not be available on a system, support for it is provided as an additional layer on top of the normal Intel® Trace Collector.
This layer is implemented in the
VT_sample.c
source file. It is a sample file that traces counters available through PAPI High level API.
To record hardware counters, do the following:
- Adjust theVT_sample.csample with the necessary counters
- Rebuild thelibVTsample.sofile:
- Copy the contents of<isntall-dir>/slibdirectory into your working directory.
- Edit the providedMakefileto match the local setup.
- Build the file using themakecommand.
- Set theLD_LIBRARY_PATHenvironment variable as follows:$ export LD_LIBRARY_PATH=<path_to_libVTsample>:<path_to_PAPI>
- AddlibVTsample.soto the link line in front of the Intel Trace Collector library. The link line will look as follows:$ mpiicc ctest.c -L$VT_SLIB_DIR -L. -L$PAPI_ROOT -lVTsample -lVT -lpapi $VT_ADD_LIBS -o ctest
To view the counters in Intel Trace Analyzer GUI, use
Counter Timeline
.