Add virtual counters pai_user and pai_kernel to detail all Processor Activity
Instrumentation (PAI) counters in user resp. kernel space. Once activated,
they will show all counters for the corresponding set. Add option -n to limit
the display to only non-zero counter values.
Add support for cpu hotplug events based on libudev. CPU hotplug events are
used to either detach from a vanishing CPU or (re-)attach to a (re-)appearing
CPU. In that case, a "hotplug detected" virtual counter is set to a non-zero
value to indicate possible loss of counters which happens when CPACF is used
on the CPU before cpacfstatsd could attach to it. The hotplug indication is
cleared once all counters are deactivated.
Add support for JSON output. The JSON document is an array of JSON objects
representing the counters and their values. Every object has a name (property
"counter") and a value (property "value"). For PAI counters, the counters
also have a space (property "space") determining the counter set pai_user or
pai_kernel, and a numeric id (property "counterid") that can be used to filter
the JSON document.
Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-By: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
cpacfstatsd now correctly handles offline cpus and dynamically attaches to
cpus once they get online. If events are enabled when a hotplug event
occurs, cpacfstatsd uses a pseudo-counter to notify user applications about
the occurence of this event and a potential data inaccuracy.
cpacfstats shows if a hotplug event has been detected since at least one
counter was activated. As soon as all counters are deactivated, the
hotplug detection state is reset.
Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-By: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The cpacfstats daemon is susceptible to dos attacks from malicious clients
that connect but either do not send a query or receive an answer fast
enough. The latter currently is impossible but might occur once we
introduce further counters.
Solve both problems by exploiting a timed read/write operation in the
daemon and close the connection on timeout.
Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-By: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
libpfm does not yet include counters introduced with z15 in a release.
cpacfstatsd now implements its own counter logic to become independent
of the slow release cycles of libpfm.
Reviewd-By: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewd-By: Harald Freudenberger <freude@de.ibm.com>
Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
z15 architecture supports counters for ECC operations. We now add and evaluate
these counters on supported architectures. If ECC counters are not supported,
we simply print "unsupported" for ECC counter values.
Manpages adapted accordingly.
Signed-off-by: Juergen Christ <juergen.christ@ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
The newer perf_event_open syscall needs a struct
perf_event_attr with the size field set correctly. Older
versions did not even provide this field. However, this
field is now set to the correct size value.
Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@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>