Skip to main content
libqcperf is an open-source C library for real-time hardware performance monitoring on Qualcomm platforms. It provides a unified API that dispatches to pluggable backends, each targeting a specific hardware subsystem. Data is collected asynchronously on a background thread and delivered to your application through a registered callback at a configurable streaming rate. Source code and issue tracker: github.com/qualcomm/libqcperf

Backends

Each backend targets a specific subsystem and platform. You select which backends to compile in at build time.

Build

Linux ARM64 (cross-compile)

1

Install prerequisites

Download the ARM GNU Toolchain for your host and set the path:
2

Configure with CMake

Key flags:
3

Build

Outputs land in the build directory root: libQcPerfCore.a (static) or libQcPerfCore.so (shared), and the QcPerfCoreTest executable.

CMake presets

Edit qcperf/CMakeUserPresets.json to set AARCH64_TOOLCHAIN_PATH and ProjectVersion once, then use the named presets:
Available presets: linux-aarch64-debug, linux-aarch64-release, linux-aarch64-debug-shared, linux-aarch64-release-shared.

Windows ARM64

API overview

All functions return a QcPerfReturnCode. Include qcperf.h and qcperf_common.h.

Test application

The build produces QcPerfCoreTest, a single-file C program that exercises the complete library lifecycle. It is the canonical usage example.

Running the test application

Examples:

Lifecycle

The test application walks through the full API sequence:
1

Initialize

2

Connect to backend

3

Discover capabilities

4

Register data callback

5

Start, collect, stop — for each capability

6

Disconnect and deinitialize

Callback implementations

The message callback receives backend log messages and prints them with a severity prefix, suppressing debug-level output:
The data callback is invoked on every streaming interval. In verbose mode it looks up the metric name, unit, and description from a pre-copied QcPerfBackendInfo; in basic mode it prints the metric ID and raw value:
The data callback runs on the library’s internal background thread. The test application deep-copies QcPerfBackendInfo before starting any monitoring session so the callback can safely read metric metadata without holding a lock.

Resources