| Skill level: | Advanced |
| Reading time: | 1 hr 30 min |
| Last updated: | 29 Jun 2026 |
| Skill level: |
| Advanced |
| Reading time: |
| 1 hr 30 min |
| Last updated: |
| 29 Jun 2026 |
This is an advanced topic for software developers who want to instrument hardware event counters or the system counter in software applications.
Upon completion of this Learning Path, you will be able to:
Before starting, you will need the following:
a1.metal instance type.This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
MRS and MSR to read the system counter and measure time around a function. You’ll then instrument event counters with PAPI, including environment configuration and user-space counter access. You’ll finish with two C examples that use perf_event_open to read either a single counter or a group of counters without multiplexing. By the end, you’ll build and run working code that returns measurable counter values suitable for basic performance instrumentation on Arm systems.These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
MRS to read a system register and MSR to write a system register. These two instructions are sufficient for the system counter example.PAPI_DIR to the location where PAPI is installed. Depending on your system, you might also need LD_LIBRARY_PATH to include $PAPI_DIR/lib.sudo command in the steps that writes the recommended value to the file under /proc/sys/kernel. This enables user-space access to the counters for the examples.perf_event_open in this Learning Path does not support multiplexing.