CPU Measurement Facility (CPUMF) for Linux on zSystems

The CPU Measurement Facility (CPUMF) provides hardware data to operating systems running in a LPAR on IBM zSystems. Besides trouble shooting it can also be used for long term analysis.

Preparation

Before you can collect data, you need to allow the LPAR in the activation profile to read the counters. Enable all four counter sets:

From Linux you then can check if the activation worked by issuing

# lscpumf -i
CPU-measurement Counter Facility
--------------------------------------------------------------------------
Version: 3.7
Authorized counter sets:
Basic counter Set
Crypto-Activity counter Set
Extended counter Set
MT-diagnostic counter Set
Problem-State counter Set
Linux perf event support: Yes (PMU: cpum_cf)

....

Long term data collection

All newer Linux distributions support the long term data collection with the new lshwc command. E.g. if you create a cpumf directory under /var/log then with

lshwc --all --interval 60 --loop 1440 > /var/log/cpumf/cpumf_`date +"%d"` 

collects the data every 60s for a total of 1440 repetitions, which translates to 24h for every minute. If you then add that line to the daily cron jobs then you keep a history of one month worth of data. Of course you can use logrotate or your favorite automation framework to compress and store away. Then generated files are in CSV format. You can post process them with your favorite tool.

Further reading

(updated 8/16/2022)

 

 

Leave a Comment

Your email address will not be published.