lshwc - Extract CPU Measurement Facilities counter sets
Use the lshwc command to extract complete counter sets from the CPU Measurement Facilities for Linux® on IBM® Z.
The command output is in comma-separated values (CSV) format. Each output line starts with a timestamp and the CPU number, followed by the extracted counter values.
lshwc syntax
Where:
- -a or --allcpu
- Displays counter values separately for each CPU. The default is a total summary line of all counters from all CPUs.
- -l or --loop <count>
- Performs the specified number of read operations.
- -i or --interval <seconds>
- Specifies a time interval, in seconds, that the command waits between read operations. The default is 60 seconds.
- <cpu>
- The number of a logical CPU.
- <from_cpu>-<to_cpu>
- A range of CPUs, where <from_cpu> is the number of the first logical CPU in the range and <to_cpu> is the number of the last logical CPU in the range. Ranges are useful if you want to extract the same counter sets for multiple, consecutive CPU numbers.
- <sets>
- A specification of counter sets to be extracted for a specified CPU or CPU range. By default,
all available counters are extracted. Use a single alphabetic character to specify a counter set.
You can specify multiple counter sets by specifying a multiple letters without a blank. In the
specification, uppercase letters are equivalent to lowercase letters.
- b|B
- Include the basic counter set.
- c|C
- Include the crypto counter set.
- e|E
- Include the extended counter set.
- m|M
- Include the MT_Diagnostic counter set.
- p|P|u|U
- Include the problem counter set.
- a|A
- Include all known counter sets. This is the default.
Examples
- This example selects the basic and problem counter sets on CPU 0 and CPU 1. Two read operations
are performed and a summary line is printed for each read operation.
# lshwc -l2 0-1:BP Date,Time,CPU,CPU_CYCLES(0),INSTRUCTIONS(1),L1I_DIR_WRITES(2),L1I_PENALTY_CYCLES(3), ... 2021-04-01,11:50:32,Total,125422,39421,304,13953,454,97489,0,0 2021-04-01,11:51:32,Total,68074231,16386850,194028,21382384,317227,104503489,777383,14198
- This example shows the counter values of the problem state counter set per CPU. CPU 0 and CPU 1
are selected.
# lshwc -l 3 -a 0-1:p Date,Time,CPU,PROBLEM_STATE_CPU_CYCLES(32),PROBLEM_STATE_INSTRUCTIONS(33) 2021-04-01,11:54:47,CPU0,0,0 2021-04-01,11:54:47,CPU1,0,0 2021-04-01,11:54:47,Total,0,0 2021-04-01,11:55:47,CPU0,818775,14198 2021-04-01,11:55:47,CPU1,125689,1306 2021-04-01,11:55:47,Total,944464,15504 2021-04-01,11:56:47,CPU0,3207071426,1489122591 2021-04-01,11:56:47,CPU1,3225092021,1489278312 2021-04-01,11:56:47,Total,6432163447,2978400903