lshwc(8)

NAME
lshwc - extract CPU Measurement Facilities counter sets

SYNOPSIS
lshwc [-a] [-l count] [-i interval] [cpulist][:sets]
lshwc -h|--help
lshwc -v|--version

DESCRIPTION
The lshwc command extracts complete counter sets from the CPU Measurement Facilities for Linux on Z. Counter sets can be specified and extracted for individual CPUs. The output is a comma-separated values file. Each line starts with a timestamp and the CPU number, followed by the extracted counter values.

OPTIONS

-h, --help
    Displays help information, then exits.

-v, --version
    Displays version information, then exits.

-a, --allcpu
    Displays counter values from each CPU. The default is a total summary line of all counters from all CPUs.

-i, --interval seconds
    Specifies a time interval, in seconds, that the command waits between read operations. The default is 60 seconds.

-l, --loop count
    Performs the specified number of read operations.

[cpulist][:sets]
    A comma-separated list of CPUs. Each CPU can optionally be followed by characters that specify the counter set. See below for details.

  CPU List and counter-set specification
In the comma-separated list of CPUs, each element is a CPU or a range of CPUs. By default, lshwc lists all CPUs.

The CPU list can be followed by an optional list of characters that specify the counter sets to be extracted, preceded by a colon. The characters can be upper or lower case. By default, all counter sets are used.

b   Include the basic counter set.

c   Include the crypto counter set.

e   Include the extended counter set.

m   Include the MT_Diagnostic counter set.

p|u Include the problem counter set.

a   Include all known counter sets (default).

Concurrency with perf tool
The lshwc tool and the linux perf tool use the same hardware and cannot be used concurrently. Both tools print an error message and abort when they detect this situation.

EXAMPLES
The first example enables the basic and problem counter sets on CPU 0 and 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),L1D_DIR_WRITES(4),
	L1D_PENALTY_CYCLES(5),PROBLEM_STATE_CPU_CYCLES(32),PROBLEM_STATE_INSTRUCTIONS(33)
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 is selected.

# lshwc -l3 -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

SEE ALSO
lscpumf(8) chcpumf(8)