CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
36 lines
1.5 KiB
Markdown
36 lines
1.5 KiB
Markdown
<a name="perf-counters" />
|
|
|
|
# User-Requested Performance Counters
|
|
|
|
When running benchmarks, the user may choose to request collection of
|
|
performance counters. This may be useful in investigation scenarios - narrowing
|
|
down the cause of a regression; or verifying that the underlying cause of a
|
|
performance improvement matches expectations.
|
|
|
|
This feature is available if:
|
|
|
|
* The benchmark is run on an architecture featuring a Performance Monitoring
|
|
Unit (PMU),
|
|
* The benchmark is compiled with support for collecting counters. Currently,
|
|
this requires [libpfm](http://perfmon2.sourceforge.net/), which is built as a
|
|
dependency via Bazel.
|
|
|
|
The feature does not require modifying benchmark code. Counter collection is
|
|
handled at the boundaries where timer collection is also handled.
|
|
|
|
To opt-in:
|
|
* If using a Bazel build, add `--define pfm=1` to your build flags
|
|
* If using CMake:
|
|
* Install `libpfm4-dev`, e.g. `apt-get install libpfm4-dev`.
|
|
* Enable the CMake flag `BENCHMARK_ENABLE_LIBPFM` in `CMakeLists.txt`.
|
|
|
|
To use, pass a comma-separated list of counter names through the
|
|
`--benchmark_perf_counters` flag. The names are decoded through libpfm - meaning,
|
|
they are platform specific, but some (e.g. `CYCLES` or `INSTRUCTIONS`) are
|
|
mapped by libpfm to platform-specifics - see libpfm
|
|
[documentation](http://perfmon2.sourceforge.net/docs.html) for more details.
|
|
|
|
The counter values are reported back through the [User Counters](../README.md#custom-counters)
|
|
mechanism, meaning, they are available in all the formats (e.g. JSON) supported
|
|
by User Counters.
|