Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 2.4 KB

README.md

File metadata and controls

40 lines (31 loc) · 2.4 KB

perf-cpp Examples

We included various examples to teach you how to use perf-cpp and leverage hardware performance counter results directly from your application.

How to Build the Examples

# Clone the repository
git clone https://github.com/jmuehlig/perf-cpp.git

# Switch to the cloned folder
cd perf-cpp

# Generate the Makefile
cmake . -B build -DBUILD_EXAMPLES=1

# Build the examples
cmake --build build --target examples

The examples will be built to build/examples/bin/.

List of Examples

Counting Hardware Events

  • single_thread.cpp provides an example to record and read performance counters for a specific code segment on a single thread.
  • inherit_thread.cpp advances the example to record counter statistics not only from one but also for its child-threads.
  • multi_thread.cpp shows how to record performance counter statistics on multiple threads.
  • multi_cpu.cpp shows how to pin performance counters to specific CPU cores instead of focussing on threads and processes.

Sampling