# QairtProfile

Note

Some methods in this module are not yet implemented in the current release
and will raise an exception if called. See the C API for full functionality.

**Include:** `#include "QairtCppApi/QairtProfile.hpp"`

C++ wrapper for the QAIRT profiling API.

A Backend must be created before constructing a Profile object.
    Copy to clipboard

- namespace qairt

    - Enums

- enum class ProfileEventType : uint32\_t

    - Event type classifications for profiling events.

| Enumerator | Description |
| --- | --- |
| `Undefined` | Unclassified or unknown event type. |
| `Init` | [Context](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtContext.html#classqairt_1_1Context) creation and graph finalization stage. |
| `Finalize` | [Graph](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtGraph.html#classqairt_1_1Graph) finalize operation stage. |
| `Execute` | [Graph](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtGraph.html#classqairt_1_1Graph) execution stage. |
| `Node` | Individual operation execution; sub-event of Execute. |
| `QueueWait` | Time spent waiting in the execution queue; sub-event of Execute. |
| `ExecutePreprocess` | Pre-processing before on-device execution; sub-event of Execute. |
| `ExecuteDevice` | On-device execution stage; sub-event of Execute. |
| `ExecutePostprocess` | Post-processing after on-device execution; sub-event of Execute. |
| `DeInit` | [Context](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtContext.html#classqairt_1_1Context) teardown and resource-free stage. |
| `Trace` | [Graph](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtGraph.html#classqairt_1_1Graph) preparation and execution trace; detailed level only. |
| `Backend` | Backend-defined event type; consult backend documentation. |

*Values:*

- enumerator Undefined = 0

    - 

- enumerator Init = QAIRT\_PROFILE\_EVENTTYPE\_INIT

    - 

- enumerator Finalize = QAIRT\_PROFILE\_EVENTTYPE\_FINALIZE

    - 

- enumerator Execute = QAIRT\_PROFILE\_EVENTTYPE\_EXECUTE

    - 

- enumerator Node = QAIRT\_PROFILE\_EVENTTYPE\_NODE

    - 

- enumerator QueueWait = QAIRT\_PROFILE\_EVENTTYPE\_EXECUTE\_QUEUE\_WAIT

    - 

- enumerator ExecutePreprocess = QAIRT\_PROFILE\_EVENTTYPE\_EXECUTE\_PREPROCESS

    - 

- enumerator ExecuteDevice = QAIRT\_PROFILE\_EVENTTYPE\_EXECUTE\_DEVICE

    - 

- enumerator ExecutePostprocess = QAIRT\_PROFILE\_EVENTTYPE\_EXECUTE\_POSTPROCESS

    - 

- enumerator DeInit = QAIRT\_PROFILE\_EVENTTYPE\_DEINIT

    - 

- enumerator Trace = QAIRT\_PROFILE\_EVENTTYPE\_TRACE

    - 

- enumerator Backend = QAIRT\_PROFILE\_EVENTTYPE\_BACKEND

    -

- enum class ProfileEventUnit : uint32\_t

    - Measurement unit classifications for profiling event values.

| Enumerator | Description |
| --- | --- |
| `Undefined` | Unit is unspecified or unknown. |
| `MicroSec` | Time measured in microseconds. |
| `Bytes` | Memory measured in bytes. |
| `Cycles` | Time measured in processor cycles. |
| `Count` | Dimensionless count. |
| `Object` | Opaque object; interpretation is backend-dependent. |
| `None` | No applicable unit. |
| `Backend` | Backend-defined unit; consult backend documentation. |

*Values:*

- enumerator Undefined = 0

    - 

- enumerator MicroSec = QAIRT\_PROFILE\_EVENTUNIT\_MICROSEC

    - 

- enumerator Bytes = QAIRT\_PROFILE\_EVENTUNIT\_BYTES

    - 

- enumerator Cycles = QAIRT\_PROFILE\_EVENTUNIT\_CYCLES

    - 

- enumerator Count = QAIRT\_PROFILE\_EVENTUNIT\_COUNT

    - 

- enumerator Object = QAIRT\_PROFILE\_EVENTUNIT\_OBJECT

    - 

- enumerator None = QAIRT\_PROFILE\_EVENTUNIT\_NONE

    - 

- enumerator Backend = QAIRT\_PROFILE\_EVENTUNIT\_BACKEND

    -

- class Profile : public [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::ApiType&lt;[Profile](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7ProfileE), [QairtProfile\_V1\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtProfile.html#_CPPv417QairtProfile_V1_t)&gt;

    - *#include &lt;QairtProfile.hpp&gt;*

Wrapper for a QAIRT [Profile](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1Profile) handle.

Obtained via Backend::createProfile().
    Copy to clipboard

Public Functions

- Profile(const [Profile](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7Profile7ProfileERK7Profile)&) = delete

    - 

- Profile([Profile](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7Profile7ProfileERR7Profile)&&) noexcept = default

    - 

- [Profile](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7ProfileE) &operator=(const [Profile](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7ProfileE)&) = delete

    - 

- [Profile](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7ProfileE) &operator=([Profile](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7ProfileE)&&) noexcept = default

    - 

- inline void setConfig(const [ProfileConfiguration](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt20ProfileConfigurationE) &configs)

    - Set or update the configuration options for this profile handle.

See also

QairtProfile\_setConfig

- Parameters

    - **configs** – **[in]** [ProfileConfiguration](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileConfiguration) to apply to this profile.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle, invalid argument, in-use handle, or unsupported configuration option.

- inline std::vector&lt;[ProfileEventData](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventDataE)&gt; getEvents()

    - Get all top-level profiling events collected on this profile handle.

See also

QairtProfile\_getNumEvents

See also

QairtProfile\_getEventAt

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - Vector of [ProfileEventData](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileEventData) objects for each collected event.

- inline std::vector&lt;[ProfileEventData](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventDataE)&gt; getSubEvents(const [ProfileEventData](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventDataE) &profileEvent)

    - Get all sub-events nested under a given top-level profiling event.

Sub-events are available for events of type ProfileEventType::Execute at the detailed profiling level and represent per-operation breakdowns.

See also

QairtProfile\_getNumSubEvents

See also

QairtProfile\_getSubEventAt

- Parameters

    - **profileEvent** – **[in]** Top-level event whose sub-events to retrieve.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - Vector of [ProfileEventData](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileEventData) objects for each sub-event.

- inline Profile(const std::shared\_ptr&lt;ApiTable&gt; &apiTable, [QairtProfile\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtProfile.html#_CPPv421QairtProfile_Handle_t) handle)

    - 

- template&lt;typename T, typename U, typename V&gt;  
inline ApiType(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt7Profile7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&lt;[T](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt7Profile7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE), [U](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt7Profile7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE), [V](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt7Profile7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&gt; &parent, [detail](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtTypeTraits.html#_CPPv4N5qairt6detailE)::non\_owning\_handle&lt;handle\_type&gt; noh)

    - 

- inline explicit ApiType(const std::shared\_ptr&lt;T\_Table&gt; &apiTable)

    - 

- inline ApiType(copy\_table\_tag\_t, const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7Profile7ApiTypeE16copy_table_tag_tRK7ApiType) &other)

    - 

- ApiType() noexcept = default

    - 

- ApiType(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7Profile7ApiTypeERK7ApiType)&) = delete

    - 

- ApiType([ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt7Profile7ApiTypeERR7ApiType)&&) noexcept = default

    - 

- [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt7Profile7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE) &operator=(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt7Profile7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&) = delete

    - 

- [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt7Profile7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE) &operator=([ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt7Profile7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&&) noexcept = default

    -

Friends

- *friend class* Api

- *friend class* Backend

- *friend class* ProfileEventData

- class ProfileBackendOpaqueObject : public [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::ApiType&lt;[ProfileBackendOpaqueObject](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt26ProfileBackendOpaqueObjectE), [QairtProfile\_BackendOpaqueObjectV1\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtProfile.html#_CPPv436QairtProfile_BackendOpaqueObjectV1_t)&gt;

    - *#include &lt;QairtProfile.hpp&gt;*

Backend-specific opaque data attached to a profiling event.

Obtained via ProfileEventData::getBackendOpaqueObject().
    Copy to clipboard

Public Functions

- inline void setData([RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBufferE) data)

    - Set the opaque data buffer for this backend opaque object.

See also

QairtProfile\_BackendOpaqueObject\_setData

- Parameters

    - **data** – **[in]** Raw buffer containing the backend-specific payload.

- inline void setData(void \*data, uint64\_t size)

    - Wrapper which allows for a raw pointer and size instead of a [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1RawBuffer).

See also

[ProfileBackendOpaqueObject::setData(RawBuffer)](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileBackendOpaqueObject_1afd0d881bcd6b3f30e74a685f261ea38a)

- inline [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBufferE) getData()

    - Get the opaque data buffer from this backend opaque object.

See also

QairtProfile\_BackendOpaqueObject\_getData

- Returns

    - [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1RawBuffer) holding the backend-specific payload.

- inline void setFileName(std::string fileName)

    - Set the file name associated with this backend opaque object.

See also

QairtProfile\_BackendOpaqueObject\_setFileName

- Parameters

    - **fileName** – **[in]** File name string.

- inline std::string &getFileName()

    - Get the file name associated with this backend opaque object.

See also

QairtProfile\_BackendOpaqueObject\_getFileName

- Returns

    - Reference to the file name string, or an empty string if not set.

- template&lt;typename T, typename U, typename V&gt;  
inline ApiType(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt26ProfileBackendOpaqueObject7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&lt;[T](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt26ProfileBackendOpaqueObject7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE), [U](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt26ProfileBackendOpaqueObject7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE), [V](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt26ProfileBackendOpaqueObject7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&gt; &parent, [detail](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtTypeTraits.html#_CPPv4N5qairt6detailE)::non\_owning\_handle&lt;handle\_type&gt; noh)

    - 

- inline explicit ApiType(const std::shared\_ptr&lt;T\_Table&gt; &apiTable)

    - 

- inline ApiType(copy\_table\_tag\_t, const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt26ProfileBackendOpaqueObject7ApiTypeE16copy_table_tag_tRK7ApiType) &other)

    - 

- ApiType() noexcept = default

    - 

- ApiType(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt26ProfileBackendOpaqueObject7ApiTypeERK7ApiType)&) = delete

    - 

- ApiType([ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt26ProfileBackendOpaqueObject7ApiTypeERR7ApiType)&&) noexcept = default

    - 

- [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt26ProfileBackendOpaqueObject7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE) &operator=(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt26ProfileBackendOpaqueObject7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&) = delete

    - 

- [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt26ProfileBackendOpaqueObject7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE) &operator=([ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt26ProfileBackendOpaqueObject7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&&) noexcept = default

    -

Private Functions

- inline void prepareToCross() const

    - 

- inline void updateAfterCross() const

    - 

- inline explicit ProfileBackendOpaqueObject(const std::shared\_ptr&lt;ApiTable&gt; &apiTable)

    -

Private Members

- mutable [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBufferE) m\_opaqueObject = {}

    - Raw byte buffer holding the backend-specific opaque object payload.

- [detail](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtTypeTraits.html#_CPPv4N5qairt6detailE)::crossable&lt;std::string, &interface\_type::getFileName, &interface\_type::setFileName&gt; m\_fileName = {}

    - File name associated with the backend opaque object, if any.

Friends

- *friend class* Api

- class ProfileConfiguration : public [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::ApiType&lt;[ProfileConfiguration](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt20ProfileConfigurationE), [QairtProfile\_ConfigV1\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtProfile.html#_CPPv423QairtProfile_ConfigV1_t)&gt;

    - *#include &lt;QairtProfile.hpp&gt;*

Configuration object for a QAIRT profile handle.

Public Functions

- inline [ProfileConfiguration](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt20ProfileConfigurationE) &setCustomConfig([ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt19ProfileCustomConfigE) profileCustomConfig)

    - Set the backend-specific custom configuration for this profile.

See also

QairtProfile\_Config\_setCustomConfig

- Parameters

    - **profileCustomConfig** – **[in]** Backend-specific custom config handle.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - Reference to this [ProfileConfiguration](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileConfiguration), for method chaining.

- inline [ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt19ProfileCustomConfigE) getCustomConfig() const

    - Get the backend-specific custom configuration from this profile.

See also

QairtProfile\_Config\_getCustomConfig

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - [ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileCustomConfig) wrapping the current custom config handle, or a ProfileCustomConfig(nullptr) if none was set.

- inline [ProfileConfiguration](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt20ProfileConfigurationE) &setNumMaxEvents(uint64\_t numMaxEvents)

    - Set the maximum number of profiling events to collect.

Once the limit is reached, no additional events are stored. The effective maximum is also subject to a ceiling determined by the backend and available system resources. The default is backend-specific.

See also

QairtProfile\_Config\_setMaxEvents

- Parameters

    - **numMaxEvents** – **[in]** Maximum number of events to store.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - Reference to this [ProfileConfiguration](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileConfiguration), for method chaining.

- inline uint64\_t getNumMaxEvents() const

    - Get the configured maximum number of profiling events.

See also

QairtProfile\_Config\_getMaxEvents

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - Maximum number of events that will be stored, as previously set by [setNumMaxEvents()](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileConfiguration_1aa8685be40ea6b1a70ca18cabe500b6d8).

- inline [ProfileConfiguration](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt20ProfileConfigurationE) &setEnableOpTrace(bool enableOpTrace)

    - Set whether op-trace profiling is enabled.

See also

QairtProfile\_Config\_setEnableOpTrace

- Parameters

    - **enableOpTrace** – **[in]** `true` to enable op-trace; `false` to disable.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - Reference to this [ProfileConfiguration](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileConfiguration), for method chaining.

- inline bool getEnableOpTrace() const

    - Get whether op-trace profiling is enabled.

See also

QairtProfile\_Config\_getEnableOpTrace

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - `true` if op-trace is enabled; `false` otherwise.

- template&lt;typename T, typename U, typename V&gt;  
inline ApiType(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt20ProfileConfiguration7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&lt;[T](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt20ProfileConfiguration7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE), [U](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt20ProfileConfiguration7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE), [V](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt20ProfileConfiguration7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&gt; &parent, [detail](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtTypeTraits.html#_CPPv4N5qairt6detailE)::non\_owning\_handle&lt;handle\_type&gt; noh)

    - 

- inline explicit ApiType(const std::shared\_ptr&lt;T\_Table&gt; &apiTable)

    - 

- inline ApiType(copy\_table\_tag\_t, const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt20ProfileConfiguration7ApiTypeE16copy_table_tag_tRK7ApiType) &other)

    - 

- ApiType() noexcept = default

    - 

- ApiType(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt20ProfileConfiguration7ApiTypeERK7ApiType)&) = delete

    - 

- ApiType([ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt20ProfileConfiguration7ApiTypeERR7ApiType)&&) noexcept = default

    - 

- [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt20ProfileConfiguration7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE) &operator=(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt20ProfileConfiguration7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&) = delete

    - 

- [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt20ProfileConfiguration7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE) &operator=([ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt20ProfileConfiguration7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&&) noexcept = default

    -

Private Functions

- inline explicit ProfileConfiguration(const std::shared\_ptr&lt;ApiTable&gt; &apiTable)

    -

Friends

- *friend class* Api

- class ProfileCustomConfig

    - *#include &lt;QairtProfile.hpp&gt;*

Opaque handle for backend-specific profile configuration.

Wraps a QairtProfile_CustomConfigHandle_t. Refer to the backend
       documentation for valid values and usage.
    Copy to clipboard

Public Functions

- inline explicit ProfileCustomConfig([QairtProfile\_CustomConfigHandle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtProfile.html#_CPPv433QairtProfile_CustomConfigHandle_t) handle)

    - Construct a [ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileCustomConfig) wrapping an existing C handle.

- Parameters

    - **handle** – **[in]** Backend-specific custom config handle.

- ProfileCustomConfig(const [ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt19ProfileCustomConfig19ProfileCustomConfigERK19ProfileCustomConfig)&) noexcept = default

    - 

- ProfileCustomConfig([ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt19ProfileCustomConfig19ProfileCustomConfigERR19ProfileCustomConfig)&&) noexcept = default

    - 

- [ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt19ProfileCustomConfigE) &operator=(const [ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt19ProfileCustomConfigE)&) noexcept = default

    - 

- [ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt19ProfileCustomConfigE) &operator=([ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt19ProfileCustomConfigE)&&) noexcept = default

    - 

- inline bool operator==(const [ProfileCustomConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt19ProfileCustomConfigE) &other) const

    -

Private Members

- [QairtProfile\_CustomConfigHandle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtProfile.html#_CPPv433QairtProfile_CustomConfigHandle_t) m\_handle

    - Underlying C handle for the backend-specific custom config.

Friends

- *friend class* ProfileConfiguration

- class ProfileEventData : public [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::ApiType&lt;[ProfileEventData](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventDataE), [QairtProfile\_EventV1\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtProfile.html#_CPPv422QairtProfile_EventV1_t)&gt;

    - *#include &lt;QairtProfile.hpp&gt;*

A single profiling event returned by a QAIRT [Profile](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1Profile) handle.

Public Functions

- inline ProfileEventData(const std::shared\_ptr&lt;ApiTable&gt; &apiTable, [QairtProfile\_EventHandle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtProfile.html#_CPPv426QairtProfile_EventHandle_t) handle)

    - 

- inline [ProfileEventType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventTypeE) getEventType() const

    - Get the event type classification for this profiling event.

See also

QairtProfile\_Event\_getEventType

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - ProfileEventType enumerator for this event.

- inline void setEventType([ProfileEventType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventTypeE) type)

    - Set the event type classification for this profiling event.

See also

QairtProfile\_Event\_setEventType

- Parameters

    - **type** – **[in]** Event type to assign to this event.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle or invalid argument.

- inline [ProfileEventUnit](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventUnitE) getEventUnit() const

    - Get the measurement unit for this profiling event’s scalar value.

See also

QairtProfile\_Event\_getUnit

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - ProfileEventUnit enumerator for this event.

- inline void setEventUnit([ProfileEventUnit](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventUnitE) unit)

    - Set the measurement unit for this profiling event’s scalar value.

See also

QairtProfile\_Event\_setUnit

- Parameters

    - **unit** – **[in]** Measurement unit to assign to this event.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle or invalid argument.

- inline uint64\_t getTimestamp() const

    - Get the timestamp recorded for this profiling event.

See also

QairtProfile\_Event\_getTimestamp

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle or if the event does not support timestamps.

- Returns

    - Timestamp in microseconds.

- inline void setTimestamp(uint64\_t timestamp)

    - Set the timestamp for this profiling event.

See also

QairtProfile\_Event\_setTimestamp

- Parameters

    - **timestamp** – **[in]** Timestamp in microseconds.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle or if the event does not support timestamps.

- inline const std::string &getIdentifier() const

    - Get the string identifier for this profiling event.

See also

QairtProfile\_Event\_getIdentifier

- Returns

    - Const reference to the identifier string; empty if not set.

- inline void setIdentifier(std::string identifier)

    - Set the string identifier for this profiling event.

See also

QairtProfile\_Event\_setIdentifier

- Parameters

    - **identifier** – **[in]** Descriptive name for this event.

- inline const [Scalar](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtOpConfig.html#_CPPv4N5qairt6ScalarE) &getScalar() const

    - Get the scalar measurement value for this profiling event.

See also

QairtProfile\_Event\_getScalar

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - Const reference to the [Scalar](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtOpConfig.html#classqairt_1_1Scalar) value associated with this event.

- inline void setScalar(const [Scalar](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtOpConfig.html#_CPPv4N5qairt6ScalarE) &scalar)

    - Set the scalar measurement value for this profiling event.

See also

QairtProfile\_Event\_setScalar

- Parameters

    - **scalar** – **[in]** [Scalar](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtOpConfig.html#classqairt_1_1Scalar) value to associate with this event.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- inline [ProfileBackendOpaqueObject](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt26ProfileBackendOpaqueObjectE) getBackendOpaqueObject() const

    - Get the backend opaque object attached to this profiling event.

Only available for events that support the extended event format. Call [supportsExtendedFormat()](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileEventData_1a323231d4f86b5a970285d9d7ae0aa6af) to check before calling this method.

See also

QairtProfile\_Event\_getBackendOpaqueObject

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle or if the event does not support backend opaque objects.

- Returns

    - [ProfileBackendOpaqueObject](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileBackendOpaqueObject) holding the backend-specific payload.

- inline void setBackendOpaqueObject(const [ProfileBackendOpaqueObject](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt26ProfileBackendOpaqueObjectE) &obj)

    - Set the backend opaque object for this profiling event.

Only valid for events that support the extended event format. Call [supportsExtendedFormat()](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileEventData_1a323231d4f86b5a970285d9d7ae0aa6af) to check before calling this method.

See also

QairtProfile\_Event\_setBackendOpaqueObject

- Parameters

    - **obj** – **[in]** [ProfileBackendOpaqueObject](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileBackendOpaqueObject) to attach to this event.

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle or if the event does not support backend opaque objects.

- inline bool supportsExtendedFormat() const

    - Query whether this event supports the extended event format.

Extended format events support timestamp and backend opaque object fields. Call this before [getTimestamp()](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileEventData_1ac456fc37fc8ee618cd5ff4f87f0206a0) or [getBackendOpaqueObject()](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#classqairt_1_1ProfileEventData_1a2a35c8cb511366114959d368841e02aa) to avoid exceptions on events that do not carry those fields.

See also

QairtProfile\_Event\_supportsExtendedEvent

- Throws

    - [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Exception](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtApi.html#_CPPv4N5qairt9ExceptionE) – on invalid handle.

- Returns

    - `true` if extended event fields are available; `false` otherwise.

- template&lt;typename T, typename U, typename V&gt;  
inline ApiType(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt16ProfileEventData7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&lt;[T](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt16ProfileEventData7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE), [U](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt16ProfileEventData7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE), [V](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt16ProfileEventData7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&gt; &parent, [detail](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtTypeTraits.html#_CPPv4N5qairt6detailE)::non\_owning\_handle&lt;handle\_type&gt; noh)

    - 

- inline explicit ApiType(const std::shared\_ptr&lt;T\_Table&gt; &apiTable)

    - 

- inline ApiType(copy\_table\_tag\_t, const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventData7ApiTypeE16copy_table_tag_tRK7ApiType) &other)

    - 

- ApiType() noexcept = default

    - 

- ApiType(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventData7ApiTypeERK7ApiType)&) = delete

    - 

- ApiType([ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4N5qairt16ProfileEventData7ApiTypeERR7ApiType)&&) noexcept = default

    - 

- [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt16ProfileEventData7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE) &operator=(const [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt16ProfileEventData7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&) = delete

    - 

- [ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt16ProfileEventData7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE) &operator=([ApiType](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtProfile.html#_CPPv4I000EN5qairt16ProfileEventData7ApiTypeERK7ApiTypeI1T1U1VEN6detail17non_owning_handleI11handle_typeEE)&&) noexcept = default

    -

Private Functions

- inline explicit ProfileEventData(const std::shared\_ptr&lt;ApiTable&gt; &apiTable)

    - 

- inline void setEventId(uint64\_t eventId)

    - 

- inline void prepareToCross() const

    - 

- inline void updateAfterCross() const

    -

Private Members

- uint64\_t m\_eventId = {}

    - Internal event identifier used to index into the profile event cache.

- mutable [detail](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtTypeTraits.html#_CPPv4N5qairt6detailE)::crossable&lt;std::string, &interface\_type::getIdentifier, &interface\_type::setIdentifier&gt; m\_identifier

    - String identifier for this event, lazily synchronized with the C layer.

- mutable [detail](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtTypeTraits.html#_CPPv4N5qairt6detailE)::crossable&lt;[detail](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtTypeTraits.html#_CPPv4N5qairt6detailE)::non\_owning&lt;[Scalar](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtOpConfig.html#_CPPv4N5qairt6ScalarE)&gt;, &interface\_type::getScalar, nullptr&gt; m\_scalar

    - [Scalar](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtOpConfig.html#classqairt_1_1Scalar) value for this profiling event.

Friends

- *friend class* Api

- *friend class* Profile

Last Published: Jun 04, 2026

[Previous Topic
QairtMem](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/cpp-api_QairtMem.md) [Next Topic
QairtLog](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/cpp-api_QairtLog.md)