libperfmon Tutorial: Collecting Profiling Statistics
A high-level interface for statistical sampling of the program's execution
is also provided by libperfmon.
- emonstartup() can be used to manually instrument a program to
collect profiling statistics. A selection of predefined profiling metrics
is provided by this call which makes it easier to use than eprofil().
- The start collection, stop collection, and write data controls for
profiling are accomplished through calls to emoncontrol().
- The standard -p compiler switch can be used to automatically
instrument a program to collect standard profiling data. When this
is used, the entire program is instrumented and the sampling occurs
during the entire run.
Note: Do not use the -p compiler switch at this time.
Program will not run if it is used.
- emoncontrol() can be used in conjunction with programs that
are automatically instrumented to limit where and when the sampling occurs.
- Profiling data is written to a file in
a non-human readable form. Until the profile tool is available, a user
must extract the data from the file based on the file layout description
contained in the Performance Monitoring Library EPS.
Use the perfmonerror() call to print an error string if -1 (or -1.0)
is returned by any of these calls.
Acknowledgement and Disclaimer