Event Attribute Structure. More...
Data Structures | |
union | message_t |
Message assigned to this attribute structure. More... | |
union | payload_t |
Payload assigned to this event. More... |
Data Fields | |
uint16_t | version |
Version flag of the structure. | |
uint16_t | size |
Size of the structure. | |
uint32_t | category |
ID of the category the event is assigned to. | |
int32_t | colorType |
Color type specified in this attribute structure. | |
uint32_t | color |
Color assigned to this event. | |
int32_t | payloadType |
Payload type specified in this attribute structure. | |
int32_t | reserved0 |
union nvtxEventAttributes_v1::payload_t | payload |
int32_t | messageType |
Message type specified in this attribute structure. | |
union nvtxEventAttributes_v1::message_t | message |
This structure is used to describe the attributes of an event. The layout of the structure is defined by a specific version of the tools extension library and can change between different versions of the Tools Extension library.
The caller should always perform the following three tasks when using attributes:
Zeroing the structure sets all the event attributes types and values to the default value.
The version and size field are used by the Tools Extension implementation to handle multiple versions of the attributes structure.
It is recommended that the caller use one of the following to methods to initialize the event attributes structure:
If the caller uses Method 1 it is critical that the entire binary layout of the structure be configured to 0 so that all fields are initialized to the default value.
The caller should either use both NVTX_VERSION and NVTX_EVENT_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values and a versioned type (Method 2). Using a mix of the two methods will likely cause either source level incompatibility or binary incompatibility in the future.
In the example the caller does not have to set the value of nvtxEventAttributes_v1::category or nvtxEventAttributes_v1::payload as these fields were set to the default value by {0}.