Describes the structures and constants used by the Performance Monitor APIs subroutines.
#include <pmapi.h>
The pmapi.h file defines the following symbolic constants, types, and structures:
MAX_COUNTERS | Maximum number of supported counters |
MIN_THRESH_VALUE | Specifies the minimum threshold value |
MAX_THRESH_VALUE | Specifies the maximum threshold value |
THRESH_SHIFT_MODE | Specifies the shift to use to put threshold into pm_mode_t.b.threshold |
COUNT_NOTHING | Specifies to not count event |
Constants for event filters
PM_VERIFIED | Specifies events that have been verified |
PM_UNVERIFIED | Specifies events that have not been verified |
PM_CAVEAT | Specifies events that work with caveats |
PM_GET_GROUPS | Not a filter; specifies that supported event groups are to be returned. |
Constants for setting mode bits
PM_PROCTREE | Turns process tree counting on |
PM_COUNT | Turns counting on immediately |
PM_USER | Turns user mode counting on |
PM_KERNEL | Turns kernel mode counting on |
PM_PROCESS | Creates a process level group |
The structure pm_info_t contains the following members:
int maxpmcs /* number of available counters int *maxevents /* number of events for each hw counter pm_events_t **list_events /* list of available events int thresholdmult /* threshold multiplier char *proc_name /* processor name int hthresholdmult upper threshold multiplier
The structure pm_events_t contains the following members:
int event_id event number char status 'v': verified 'u': unverified 'c': caveat char threshold 'y': thresholdable 'g': group-only 'G': thresholdable group-only char *short_name mnemonic name char *long_name long name char *description full description
The structure pm_groups_info_t contains the following members:
int maxgroups number of available groups pm_groups_t *event_groups list of event groups
The structure pm_groups_t contains the following members:
int group_id group number int *events events in this group, by ID # char *short_name mnemonic name char *long_name long name char *description full description
The structure pm_prog_t contains the following members:
unsigned:6 mode.b.threshold threshold value unsigned:1 mode.b.thresh_res use upper threshold mutiplier if set unsigned:1 mode.b.is_group is an event group unsigned:1 mode.b.process process level group indicator unsigned:1 mode.b.kernel turns kernel mode counting on unsigned:1 mode.b.user turns user mode counting on unsigned:1 mode.b.count counting state unsigned:1 mode.b.proctree turns process tree counting on int events[MAX_COUNTERS] list of counted events
The structure pm_data_t contains the following members:
pm_ginfo_t ginfo group information long long accu[MAX_COUNTERS] accumulated data
The structure pm_ginfo_t contains the following members:
int members; /* number of threads in group unsigned:1 flags.b.process /* process level group indicator unsigned:1 flags.b.consistent /* group data consistent with members
The following are declared as functions:
double pm_cycles(void) void pm_error(char *where, int error) int pm_init(int filter, pm_info_t *pminfo, pm_groups_info_t *pmgroupsinfo) int pm_set_program(pm_prog_t *prog) int pm_get_program(pm_prog_t *prog) int pm_start(void) int pm_stop(void) int pm_reset_data(void) int pm_get_data(pm_data_t *data) int pm_get_tdata(pm_data_t *data, timebasestruct_t *time) int pm_get_data_cpu(int cpuid, pm_data_t *data) int pm_get_tdata_cpu(int cpuid, pm_data_t *data, timebasestruct_t *time) int pm_delete_program(void) int pm_set_program_mythread(pm_prog_t *prog) int pm_get_program_mythread(pm_prog_t *prog) int pm_start_mythread(void) int pm_stop_mythread(void) int pm_reset_data_mythread(void) int pm_get_data_mythread(pm_data_t *data) int pm_get_tdata_mythread(pm_data_t *data, timebasestruct_t *time) int pm_delete_program_mythread(void) int pm_set_program_thread(pid_t pid, tid_t tid, pm_prog_t *prog) int pm_get_program_thread(pid_t pid, tid_t tid, pm_prog_t *prog) int pm_start_thread(pid_t pid, tid_t tid) int pm_stop_thread(pid_t pid, tid_t tid) int pm_reset_data_thread(pid_t pid, tid_t tid) int pm_get_data_thread(pid_t pid, tid_t tid, pm_data_t *data) int pm_get_tdata_thread(pid_t pid, tid_t tid, pm_data_t *data, timebasestruct_t *time) int pm_delete_program_thread(pid_t pid, tid_t tid) int pm_set_program_mygroup(pm_prog_t *prog) int pm_get_program_mygroup(pm_prog_t *prog) int pm_start_mygroup(void) int pm_stop_mygroup(void) int pm_reset_data_mygroup(void) int pm_get_data_mygroup(pm_data_t *data) int pm_get_tdata_mygroup(pm_data_t *data, timebasestruct_t *time) int pm_delete_program_mygroup(void) int pm_set_program_group(pid_t pid, tid_t tid, pm_prog_t *prog) int pm_get_program_group(pid_t pid, tid_t tid, pm_prog_t *prog) int pm_start_group(pid_t pid, tid_t tid) int pm_stop_group(pid_t pid, tid_t tid) int pm_reset_data_group(pid_t pid, tid_t tid) int pm_get_data_group(pid_t pid, tid_t tid, pm_data_t *data) int pm_get_tdata_group(pid_t pid, tid_t tid, pm_data_t *data, timebasestruct_t *time) int pm_delete_program_group(pid_t pid, tid_t tid)
The pm_cycles subroutine, pm_error subroutine, pm_init subroutine.
The pm_set_program subroutine, pm_get_program subroutine, pm_delete_program subroutine, pm_get_data subroutine, pm_get_tdata subroutine, pm_get_data_cpu subroutine, pm_get_tdata_cpu subroutine, pm_start subroutine, pm_stop subroutine, pm_reset_data subroutine.
The pm_set_program_mythread subroutine, pm_get_program_mythread subroutine, pm_delete_program_mythread subroutine, pm_get_data_mythread subroutine, pm_get_tdata_mythread subroutine, pm_start_mythread subroutine, pm_stop_mythread subroutine, pm_reset_data_mythread subroutine.
The pm_set_program_mygroup subroutine, pm_get_program_mygroup subroutine, pm_delete_program_mygroup subroutine, pm_get_data_mygroup subroutine, pm_start_mygroup subroutine, pm_stop_mygroup subroutine, pm_reset_data_mygroup subroutine.
The pm_set_program_thread subroutine, pm_get_program_thread subroutine, pm_delete_program_thread subroutine, pm_get_data_thread subroutine, pm_get_tdata_thread subroutine, pm_start_thread subroutine, pm_stop_thread subroutine, pm_reset_data_thread subroutine.
The pm_set_program_group subroutine, pm_get_program_group subroutine, pm_delete_program_group subroutine, pm_get_data_group subroutine, pm_get_tdata_group subroutine.pm_start_group subroutine, pm_stop_group subroutine, pm_reset_data_group subroutine.