The pmapi library
Review the rules that are for the pmapi library.
The following rules are common to the Performance Monitor APIs:
-
- The pm_initialize routine must be called before any API call is made, and only events returned by a given pm_initialize call with its associated filter setting can be used in subsequent pm_set_program calls.
- PM contexts cannot be reprogrammed or reused at any time. This means that none of the APIs support more than one call to a pm_set_program interface without a call to a pm_delete_program interface. This also means that when creating a process group, none of the threads in the process is permitted to already have a context.
- All the API calls return 0 when successful or a positive error code (which can be decoded using pm_error) otherwise.