chcpumf must be executed as root. A non-root user sees this error
message:
[tester@t35lp46 ~]$ chcpumf -m 1000
Error: /sys/module/kernel/parameters/cpum_sfb_size: Permission denied
[tester@t35lp46 ~]$
Enhance the error message and be clear about the root cause:
[tester@t35lp46 ~]$ chcpumf-new -m 1000
Error: Must run as root
[tester@t35lp46 ~]$
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
chcpumf does not print out version (option -v) or help text
(option -h) when the CPU Measurement Sampling facility is not
installed. This was different up to and including release 4.10.
Fix this and hounour option -v and option -h even when
the sampling facility is not installed.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Set the counter name for z15 counter numbered 265. It is either named
DFLT_CCERROR or DFLT_CCFINISH, depending on the linux version. The
counter was renamed from CCERROR to CCFINISH in linux version 5.8.
Check for existence of file /sys/devices/cpum_cf/events/DLFT_CCERROR.
f this file exists the counter is named DFLT_CCERROR else
DFLT_CCFINISH (only for z15), other machines do not have this counter.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Rewrite lscpumf and chcpumf in C. The previous version
habe been written in perl which require a lot of instructure.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The pod2usage function from module Pod::Usage always emits this warning
when the module is loaded, even if the funtion is not invoked at all:
The script_run feature is experimental in regex;
marked by <-- HERE in m/(*script_run: <-- HERE ^ .* $ )/
at (eval 14) line 2.
To avoid this warning every time the cpumf_helper script is invoked,
do not use function pod2usage. The use of this function has no
benefit. cpumf_helper is invoked under the covers from lscpumf and
chcpumf, so it is sufficient to print the help text in case a wrong
parameter has been supplied.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Add IBM Z15 extended counter definition file to Makefile
DATA_FILES list.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Add support for new deflate counters:
- Counter 247: cycles CPU spent obtaining access to Deflate unit
- Counter 252: cycles CPU is using Deflate unit
- Counter 264: Increments by one for every DEFLATE CONVERSION CALL
instruction executed.
- Counter 265: Increments by one for every DEFLATE CONVERSION CALL
instruction executed that ended in Condition Codes
0, 1 or 2.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Add support for CPU-Measurement facility counter second version
number 6. This adds some more counters to the crypto counter set.
Extended counter set is the same as for z14.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Running lscpumf -i as regular user causes a warning when trying to
disply sampling buffer sizes. The root cause is in the cpumf_helper
that returns "0,0" instead of a list reference "[0,0]".
This happened when running as regular user because the sampling buffer
size sysfs attribute is not readable for them.
Remove the shortcut and always return a list reference.
Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The short descriptions for a counter in the extender counter
set should be identical for all models.
This patch fixes minor differences.
Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The cpumf_helper.in is called to parse counter definition
files stored in /usr/share/s390-tools/cpumf directory and
returns perl references to be examined by other perl tools
such as lsctrdef.
cpumf_helper.in expects several keywords in the counter
definition files, one is 'shortdesc' which contains
a short description of the purpose of the counter.
However this short description not is stored in the hash
field shortdesc keyed by counter number 'ctr' because the
wrong key is used.
Output before:
{
'64' => {
'desc' => 'Total number of the PRNG functions issued by the CPU',
'name' => 'PRNG_FUNCTIONS',
'set' => 8
},
'65' => {
'desc' => 'Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU',
'name' => 'PRNG_CYCLES',
'set' => 8
},
....
'ctr' => { <-------- WRONG
'shortdesc' => 'AES Blocked Cycles'
}
}
Output with this patch:
{
'64' => {
'desc' => 'Total number of the PRNG functions issued by the CPU',
'name' => 'PRNG_FUNCTIONS',
'set' => 8,
'shortdesc' => 'PRNG Functions'
},
'65' => {
'desc' => 'Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU',
'name' => 'PRNG_CYCLES',
'set' => 8,
'shortdesc' => 'PRNG Cycles'
},
...
}
Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Update the cpumf helper program to read the split counter set
definition files. Changes to higher-level program like lscpumf
are not necessary.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
With z14, the counters in the problem-state are reduced resulting
in an increased first version number of the CPUM CF. To adapt to
this change, split the counter sets according to their counter
first and second version number. The second version number controls
the crypto-activity and extended counter set. Treat the crypto-activity
counter set as generic, as the extended counter set is already handled
based on hardware models.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
This commit is based on the s390-tools-1.39.0 version.
Changes on top of s390-tools-1.39.0:
- Add MIT license to all source files
- Add LICENSE file
- Transform REAMDE to README.md (markdown)
- Add AUTHORS.md file
- Add CONTRIBUTING.md file
- Move changelog from README to CHANGELOG.md file
Reviewed-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>