GeezerVison is showing cpp.libhunt.com โ perf-cpp/CHANGELOG and perf-cpp Releases | LibHunt
Lightweight recording and sampling of performance counters for specific code segments directly from your C++ application.
Avg Release Cycle
37 days
Latest Release
166 days ago
-
June 15, 2026
- โ Removed Deprecated Header Files : All legacy
.h forwarding headers (e.g., perfcpp/sampler.h, perfcpp/event_counter.h) have been removed. Use .hpp files instead.
Richer Branch Stack Entries : Each entry in a branch stack sample can now carry additional hardware-reported metadata (see the sampling documentation):
- Classification (Linux 4.15+): the type of branch instruction, i.e., conditional, unconditional, call, return, syscall, and more.
- Speculation Result (Linux 6.1+): whether the branch was on the correct or wrong speculative path.
- Privilege Level (Linux 6.1+): whether the branch executed in user space, kernel space, or at hypervisor level.
๐ New IBS Sample Fields (AMD IBS PMU only): Three additional fields decoded from IBS raw data, none of which are accessible via the standard perf_event_open interface (see the sampling documentation):
- Op Cache Miss (
record.instruction_execution().cache()->is_op_miss()): indicates the fetch missed the op cache (decoded instruction cache), even if the L1 instruction cache hit. Enabled via sampler.values().instruction_cache(true). (IBS Fetch PMU)
- iTLB Refill Latency (
record.instruction_execution().latency().itlb_refill()): cycles to refill the instruction TLB after a miss. Only set when an iTLB miss occurred. Enabled via sampler.values().instruction_latency(true). (IBS Fetch PMU)
- Is Microcode (
record.instruction_execution().is_microcode()): indicates the sampled op was dispatched from the microcode ROM sequencer. Enabled via sampler.values().instruction_type(true). (IBS Op PMU)
๐ง Configurable Sample Timestamp Clock : SampleConfig::clock(perf::Clock) selects the POSIX clock used for timestamps, making them directly comparable to clock_gettime() values without offset calibration. Note: Clock::Realtime and Clock::Boottime are rejected by the kernel for hardware PMU events on x86. Use Clock::Monotonic or Clock::MonotonicRaw instead. See the sampling documentation.
โ Removed Deprecated Config Setters : The Config::is_pinned(bool) and Config::is_debug(bool) setters (deprecated since v0.13.0) have been removed. Use pinned(bool) and debug(bool) instead.
๐ Renamed Sample Fields : Two recording fields have clearer names. The old names still work but are deprecated and will be removed in v2.0:
values().sample_id(true) replaces values().id(true) and now matches the record.metadata().sample_id() accessor. The CSV column was renamed from id to sample_id as well.
values().data_access_misaligned(true) and record.data_access().is_misaligned() replace the *_misalign_penalty() variants.
๐ฆ CMake Package Support : Fixed the installation process. Installed builds now ship a CMake package config, so find_package(perf-cpp) works without manual setup.
Raised Compiler Requirements : Building now requires GCC 11 and newer or Clang 14 and newer (for std::from_chars support).
๐ง Extended Event Configuration : Added config3 and config4 fields for raw event configuration.
โ
Tests on ARM : x86-only tests (Sampler, live events) are skipped on other architectures, so the test suite now runs on ARM (e.g., Raspberry Pi).
๐ Bugfixes :
- Live counter reads no longer return 0 when they race a concurrent kernel update (seqlock retry in the mmap buffer).
- The flamegraph export counted every group of identical call stacks one sample too many.
- Symbol resolver: ELF virtual addresses were treated as file offsets, which produced wrong symbols. Modules that cannot be opened no longer abort resolution, and modules mapped with shared permissions are now resolved.
- Replaced
select() with poll() in the sample buffer to avoid a possible stack buffer overflow when monitoring many file descriptors.
EventCounter counted fixed hardware events incorrectly when forming groups.
- CPU detection: Intel Comet Lake was misclassified as 12th generation (it is 10th), and Intel Rocket Lake was misclassified as well.
- Hardware counter detection applied a wrong offset for the counter consumed by the NMI watchdog.
- The perf file export wrote the logical memory address and sample ID in the wrong order.
- Sampler: fixed an offset when recording performance counter values with samples, multiple IBS decoding bugs, and a missing vendor check for IBS triggers.
- Event-file parsing no longer depends on the system locale and avoids undefined behavior in the tokenizer.
- The JSON export now escapes special characters in counter and metric names.
- Register values are reported as unsigned 64-bit integers.
-
May 12, 2026
v0.14.1
- ๐ Bugfix :
UniqueFileDescriptor::reset() did not close the underlying file descriptor (see issue #12 โ thanks to @ilyapopov).
-
April 29, 2026
- ๐ Deprecation Warnings Activated : All legacy
.h forwarding headers (e.g., perfcpp/sampler.h, perfcpp/event_counter.h) now emit a compile-time #pragma message warning directing users to the .hpp replacements introduced in v0.13.0. The old headers will be removed in v1.0. If you see a deprecation message, replace the include with the .hpp variant (e.g., #include <perfcpp/sampler.hpp>).
- CGroup Monitoring : Added support for monitoring all tasks belonging to a cgroup (container). Configure a
perf::CGroupMonitor (constructed from a path, a cgroup name, a SharedFileDescriptor, or a UniqueFileDescriptor) and pass it to Config::cgroup(). Requires a specific CPU core (CpuCore::Any is rejected) and CAP_PERFMON or perf_event_paranoid <= 0. See the recording documentation.
- Sampler Input Validation : Opening a sampler with an invalid period or frequency now raises an exception immediately. Period must be greater than zero; frequency must be between 1 and the kernel's
perf_event_max_sample_rate limit.
- RAPL Energy Measurement Example : Added an example program demonstrating how to measure energy consumption of a code segment using the built-in
watts-pkg, watts-cores, and watts-ram metrics.
- ๐ Bugfixes :
perf::CpuCore now accepts std::uint16_t as a CPU core id
- Fixed multiple event codes in the event library across AMD Zen5 and Intel Panther Lake
-
April 18, 2026
๐ง Configurable Sampling Triggers : Typed triggers now fully support hardware-specific configuration:
- Intel :
perf::MemoryLoads supports configurable min_latency for PEBS load latency filtering. perf::MemoryStores and perf::MemoryLoadsAux provide type-safe alternatives to string-based mem-stores and mem-loads-aux triggers. String-based triggers remain available and documented.
- AMD :
perf::IbsOp and perf::IbsFetch now build their counter configuration directly from hardware capabilities, fully supporting is_uop, is_l3_miss_only, and is_rand flags. String-based trigger variants (ibs_op_uops, ibs_op_l3missonly, ibs_op_uops_l3missonly, ibs_fetch_l3missonly) still work but are no longer documented. Use typed triggers for full configurability.
๐ Fixed-Function PMC Scheduling : On Intel processors, the built-in events instructions, cycles, cpu-cycles, and ref-cycles are now automatically scheduled to dedicated pinned groups. This prevents the kernel scheduler from placing fixed-function PMC events alongside generic events, which would distort multiplexing ratios. Fixed groups do not count against the generic PMC limit.
๐ Fixed PMC Detection : Added HardwareInfo::physical_fixed_performance_counters_per_logical_core(), which reads the number of fixed-function performance counters on Intel.
Built-in Event : Added ref-cycles (reference cycles at a fixed frequency, unaffected by turbo boost or power-saving states) to the built-in hardware event list.
๐ Bugfixes :
- Fixed out-of-bounds access when reading live counter values.
- Fixed wrong parsing order for throttle events in the sample decoder.
- Fixed sample decoder always reporting a data access source even when none was available (e.g., when sampling stores on Intel hardware).
- Fixed various decoding bugs and hardened the sample decoder against malformed records.
- Adding events to an already-opened
EventCounter now raises an exception instead of silently failing.
-
March 28, 2026
- Header Restructuring : Headers have been reorganized into
counter/, sample/, metric/, analyzer/, and util/ subdirectories and renamed from .h to .hpp. The previous .h headers remain as forwarding includes with deprecation notices and will be removed in v1.0.
- ๐ฅ Breaking :
EventCounter::add() and start() (including Sampler::start() and all multi-thread/core variants) now return void instead of bool. Errors are communicated via exceptions; the return values were unused.
- ๐ Compile Flag for AUX Buffer Support : Added
PERFCPP_NO_SAMPLE_AUX compile flag to disable auxiliary buffer sampling on systems with Linux kernels older than 5.5 that lack PERF_SAMPLE_AUX support. Thanks to @rconnorlawson.
- Perf File Export : Fixed bugs in perf format when materializing samples into file that can be read via
perf [mem] report.
- NMI Watchdog Detection : Hardware counter detection now accounts for the NMI watchdog permanently consuming one hw-PMU counter, fixing incorrect counter counts on systems with the watchdog enabled.
- RAPL Power Metrics : Added built-in
watts-pkg, watts-cores, and watts-ram metrics for measuring power consumption via RAPL energy counters (see the documentation).
- ๐ฆ Conan Package : Added Conan 2.x package recipe for easier integration.
- Config Setter Naming : Standardized
Config setter naming โ setters no longer use the is_ prefix (e.g., pinned(bool) instead of is_pinned(bool)). The old is_pinned(bool) and is_debug(bool) setters are deprecated and will be removed in v1.0.
- SampleResult CSV Export : Added
SampleResult::to_csv() returning a std::string, complementing the existing file-based overload.
- Per-Element Results : Added
result_of_thread(thread_id), result_of_process(process_id), and result_of_core(core_id) to query individual results from MultiThreadEventCounter, MultiProcessEventCounter, and MultiCoreEventCounter. Process and core variants return std::optional<CounterResult> since the ID may not be present.
- ๐ Documentation : Rewrote and restructured all documentation pages for consistency, conciseness, and correctness. Documentation is now hosted at jmuehlig.github.io/perf-cpp.
-
February 15, 2026
- CSV Export : Samples can now be exported to CSV format using
SampleResult::to_csv(), enabling custom analysis with statistical tools, spreadsheets, or data processing pipelines (see the documentation).
- Flamegraphs : Samples can be exported to flamegraphs via
SampleResult::to_flamegraphs(std::string&&) (see the documentation).
๐ง Fine-Grained Sampling Configuration : The sampling API now provides more granular control over which data fields are recorded. Previously coarse-grained options have been split into specific setters, allowing precise selection of hardware-specific metrics. See the sampling documentation for more information. New setters include:
- Physical Instruction Pointer (AMD IBS Fetch PMU only)
- Instruction Type (AMD IBS Op PMU for
Return and Branch types)
- Branch Type (AMD IBS Op PMU only)
- Instruction Latency (Intel: instruction retirement cycles; AMD IBS Op PMU: uOp tag-to-retirement, completion-to-retirement, tag-to-completion; AMD IBS Fetch PMU: fetch latency)
- Instruction Cache (AMD IBS Fetch PMU only)
- Instruction TLB (AMD IBS Fetch PMU only)
- Instruction Fetch (AMD IBS Fetch PMU only)
- Data TLB Page Size (AMD IBS Op PMU only)
- Data TLB Latency (AMD IBS Op PMU only)
- Data Access Width (AMD IBS Op PMU only)
- Data Access Misalignment Penalty (AMD IBS Op PMU only)
- MHB/MAB Allocations (AMD IBS Op PMU only)
- Auxiliary Values
โ Added perf::Config::include_host(bool) to enable excluding host events when counting hardware events in virtual machines (see the documentation).
โ Added perf::Config::is_pinned(bool) to enable pinning events to the PMU (see the documentation).
-
December 22, 2025
- ๐ Bugfix : The library could not compile for specific Linux kernels (see #10).
- ๐ Symbol Translation : Improved translation from instruction pointer to symbol.
-
October 28, 2025
- ๐ Bugfix : The library crashed when events loaded from an external CSV file contained empty spaces (see #8). Thanks to @Liteom.
- ๐ Bugfix : The library could not compile for specific Linux kernels not providing
PERF_MEM_LVLNUM_UNC and PERF_MEM_SNOOPX_PEER (see #7). Thanks to @Raphalex46 for pointing out.
- Perf Data Export : Samples can now be written as perf data files using
Sampler::to_perf_file(), enabling analysis with standard perf ecosystem tools like perf report (see the documentation). Note that this feature is experimental.
-
August 22, 2025
โก๏ธ This update simplifies the handling of counter definitions by introducing a default instance.
- 0๏ธโฃ Default Counter Definitions : Supplying a user-defined
perf::CounterDefinition to each perf::EventCounter or perf::Sampler is no longer required. If none is provided, a default instance is used automatically. Custom definitions now extend the default set of events instead of duplicating them.
-
July 19, 2025
- Metric Functions : Metrics now support built-in functions such as
ratio(A, B) and sum(A, B, C, ...), enabling more expressive and reusable formulas (see the documentation).
- โก๏ธ Optimized Compile-time Event Injection : The generated runtime event registration class is now only created if it does not already exist, reducing unnecessary recompilation.
- ๐ Improved Live Event Accuracy : Live event values now account for partial runtime durations via time scaling, improving accuracy when counters were not active for the full measurement window.
|