Skip to content

Commit

Permalink
fix(tracing/nvtx): silence -Wmissing-field-initializer warnings (aws#593
Browse files Browse the repository at this point in the history
)

Signed-off-by: Nicholas Sielicki <[email protected]>
  • Loading branch information
aws-nslick committed Sep 30, 2024
1 parent af001cb commit 7b8d234
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions include/tracing_impl/nvtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,28 @@

static inline void nvtx_mark_domain(nvtxDomainHandle_t domain, const char* name, uint32_t color)
{
const nvtxEventAttributes_t eventAttrib = {
.version = NVTX_VERSION,
.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE,
.colorType = NVTX_COLOR_ARGB,
.color = color,
.messageType = NVTX_MESSAGE_TYPE_ASCII,
.message = { .ascii = name },
};
nvtxEventAttributes_t eventAttrib = {};

eventAttrib.version = NVTX_VERSION;
eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
eventAttrib.colorType = NVTX_COLOR_ARGB;
eventAttrib.color = color;
eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
eventAttrib.message.ascii = name;

nvtxDomainMarkEx(domain, &eventAttrib);
}

static inline nvtxRangeId_t nvtx_start_domain(bool have_domain, nvtxDomainHandle_t domain, const char* name, uint32_t color) {
const nvtxEventAttributes_t eventAttrib = {
.version = NVTX_VERSION,
.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE,
.colorType = NVTX_COLOR_ARGB,
.color = color,
.messageType = NVTX_MESSAGE_TYPE_ASCII,
.message = { .ascii = name },
};
nvtxEventAttributes_t eventAttrib = {};

eventAttrib.version = NVTX_VERSION;
eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
eventAttrib.colorType = NVTX_COLOR_ARGB;
eventAttrib.color = color;
eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII;
eventAttrib.message.ascii = name;

if (have_domain)
return nvtxDomainRangeStartEx(domain, &eventAttrib);
else
Expand Down

0 comments on commit 7b8d234

Please sign in to comment.