pmctl Command

Purpose

Starts, resets, or stops generating Performance Monitor events.

Syntax

pmctl [ { [ -E [ mode ] ] [ -f interval ] {[ -y command ]}} | [ -O Options ] | [ -h ] | [ -r ] | [ -S ] ] [ -s ] [ { -a -y command [ -f interval ] }]

Description

The pmctl command starts, stops, or resets the generation of Performance Monitor events in the PMAPI subsystem to support manual offline mode with the tprof -E command. It also reports the current status of the PMAPI subsystem.

Flags

Item Description
-a Turns on large page analysis.
-E [ mode ] Enables event-based profiling. You can specify one of the following modes:
PM_event
Specifies the hardware event to profile. If no mode is specified for the -E flag, the default event is processor cycles (PM_CYC).
EMULATION
Enables the emulation profiling mode.
ALIGNMENT
Enables the alignment profiling mode.
ISLBMISS
Enables the Instruction Segment Lookaside Buffer miss profiling mode.
DSLBMISS
Enables the Data Segment Lookaside Buffer miss profiling mode.
-f interval Specifies the sampling interval to use.
  • For processor cycle, EMULATION, ALIGNMENT, ISLBMISS, and DSLBMISS events, specify 1 to 500 milliseconds (default = 10).
  • For other Performance Monitor events, specify 10000 up to MAXINT occurrences (default = 10000).
If you use the -f flag with the -y flag, specify 1 up to MAXINT occurrences for other Performance Monitor events (default = 10000).
-O options This -O option can have the following values:
threshold_cmp_val=value
Sets a threshold-compare floating point value.

The Power® processor has a threshold counter facility. The threshold counter is different from the primary performance monitor counters (PMCs) because the threshold counter can count the number of events that occur between a separate set of designated start events and end events from the core, cache, and memory subsystems.

This option specifies a threshold value that you can use to compare against the number of events between the designated start events and end events.

threshold_event_sel=name
Specifies the events that must be considered for threshold counting. Valid values for the threshold_event_sel option are as follows:
THRESHOLD_COUNT_CYCLES
Counts the number of events that occur or cycles on which the control register (CTRL) run latch has been set. The AIX® operating system uses the control register (CTRL) bit to indicate the idle or run state. The performance monitoring unit (PMU) also use this bit to avoid counting events during idle periods. This bit is commonly called the run latch. This option does not depend on freeze conditions. This means that the events are counted even when the PMU has frozen the contents of event counters.
THRESHOLD_COUNT_NUM_COMP_INSTR
Counts the number of completed instructions when the CTRL run latch is set.

This option does not depend on freeze conditions. This means that the events are counted even when the PMU has frozen the contents of event counters.

THRESHOLD_COUNT_PMC1_EVENTS
Counts the PMC1 events.

PMC1 - PMC4 are 32-bit registers that are called programmable counters because the events that can be counted are specified by the program. This option depends on freeze conditions. This means that the events are not counted when the PMU has frozen the contents of event counters.

THRESHOLD_COUNT_PMC2_EVENTS
Counts the PMC2 events. This option depends on freeze conditions. This means that the events are not counted when the PMU has frozen the contents of event counters.
THRESHOLD_COUNT_PMC3_EVENTS
Counts the PMC3 events. This option depends on freeze conditions. This means that the events are not counted when the PMU has frozen the contents of event counters.
THRESHOLD_COUNT_PMC4_EVENTS
Counts the PMC4 events. This option depends on freeze conditions. This means that the events are not counted when the PMU has frozen the contents of event counters.
-O options (continued)
threshold_eve_start_sel=name
Specifies the event to start the threshold counting. For valid values of this option, see threshold_eve_stop_sel.
threshold_eve_stop_sel=name
Specifies the event to stop the threshold counting. You can set the following values for the threshold_eve_start_sel and threshold_eve_stop_sel options:
PM_MRK_INST_DECODED
Sampled instructions are decoded.
PM_MRK_INST_DISP
Sampled instructions are dispatched.
PM_MRK_INST_ISSUED
Sampled instructions are issued.
PM_MRK_INST_FIN
Sampled instructions are finished.
PM_MRK_INST_CMPL
Sampled instructions are completed.
PM_MRK_LD_MISS_L1
Sampled instruction level 1 (L1) load cache is missed.
PM_MRK_L1_RELOAD_VALID
Sampled instruction level 1(L1) reload is valid.
EVE_SEL_PMC1
Event that is selected in monitor mode control register (MMCR) 1 for PMC1 occurred.
EVE_SEL_PMC2
Event that is selected in MMCR1 for PMC2 occurred.
EVE_SEL_PMC3
Event that is selected in MMCR1 for PMC3 occurred.
EVE_SEL_PMC4
Event that is selected in MMCR1 for PMC4 occurred.
PM_MRK_NTF_FIN
Sampled instruction is in the next to finish state.
PM_MRK_L2_RC_DISP
RC machine dispatched for sampled instruction.
PM_MRK_ST_DONE_L2
RC machine done for sampled instruction.
-O options (continued)
random_samp_ele_crit=name
Specifies the random criteria for selecting the instructions for sampling. Valid values for this option are as follows:
ALL_INSTR
All instructions are eligible. This value is the default setting.
LOAD_STORE
The operation is routed to the Load Store Unit (LSU); for example, load, store.
PROB_NOP
Sample only special no-operation instructions, which are called Probe NOP events.
LARX_STCX
Sample only load and reserve indexed (LARX) instructions and store conditional indexed (STCX) instructions.
LOAD_SAMPLING
Sample only load instructions.
LONG_LATENCY_OP
Sample only long latency instructions (div/sqrt/mul).
STORE_SAMPLING
Sample only store instructions.
LOAD_MISSES
Sample only load-miss instructions.
LOAD_HIT_STORE
Sample only load-hit-store instructions. This value is applicable only for cases where a load operation can forward data from the store queue to a finish state. This value is not applicable to cases where a load-hit-store instruction is in the store queue but the load operation partially overlaps with the store.
BRANCH_MISPREDICTS
Sample only branch-mispredict instructions.
BRANCH_MISPREDICTS_DIR_CR_CTR
Sample only branch-mispredict events (Direction, CR, or CTR).
BRANCH_MISPREDICTS_TA
Sample only branch-mispredict events (TA).
BRANCHES_RESOLVED_TAKEN
Sample branches with resolution.
NON_REPEATING_BRANCHES
Sample only non-repeating branches.
ALL_BRANCHES_REQ_PRED
Sample all branches that require prediction.
group_num=event_group
Specifies a group number that must be used for the pmctl command. This option is an optional attribute. If you specify this value, the group must have a threshold event and the same event must be used with the -E flag.
-h Prints man page information.
-r Releases and resets the PMAPI subsystem.
-S Stops generating Performance Monitor events.
-s Prints the current status of the PMAPI subsystem.
-y command Turns on the event-based profiling only for the specified command and its descendents.

Security

Attention RBAC users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To stop generating Performance Monitoring events, enter the following command:
    pmctl –S
  2. To reset generating Performance Monitoring events, enter the following command:
    pmctl –r
  3. To report the current status of the PMAPI subsystem, enter the following command:
    pmctl –s
  4. To start generating Performance Monitoring events, enter the following command:
    pmctl –E
  5. To start generating Performance Monitoring events only for the specified workload command and its descendents, enter the following command:
    pmctl –E –y workload
  6. To support the tprof -E command in manual offline mode, enter the following command:
    trace -adf -o mydata.trc
    trcon
    pmctl –E 
    sleep 10; trcstop
    gensyms > mydata.syms
    tprof –suker mydata
  7. To support the tprof -E command in manual offline mode profiling for the specified workload command and its descendents, enter the following command:
    trace -adf -o mydata.trc
    trcon
    pmctl –E –y workload
    trcstop
    gensyms > mydata.syms
    tprof –suker mydata 
  8. To count the number of threshold count events elapsed between a distinct pair of threshold start events and end events and to specify the threshold value for comparison, enter the following command:
    trace -adf -o mydata.trc
    trcon
    pmctl -E PM_THRESH_MET-O threshold_cmp_val=10000 -O
    threshold_event_sel=THRESHOLD_COUNT_CYCLES -O
    threshold_eve_start_sel=PM_MRK_L1_RELOAD_VALID -O
    threshold_eve_stop_sel=PM_MRK_ST_DONE_L2 -O
    random_samp_ele_crit=ALL_INSTR -O group_num=607
    sleep 10; trcstop
    gensyms > mydata.syms
    tprof -suker mydata