Duration::Duration(const QLoggingCategory& category, const QString& name, uint32_t argbColor, uint64_t payload, const QVariantMap& baseArgs) : DurationBase(category, name) { if (tracingEnabled() && category.isDebugEnabled()) { QVariantMap args = baseArgs; args["nv_payload"] = QVariant::fromValue(payload); tracing::traceEvent(_category, _name, tracing::DurationBegin, "", args); #if defined(NSIGHT_TRACING) nvtxEventAttributes_t eventAttrib{ 0 }; eventAttrib.version = NVTX_VERSION; eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; eventAttrib.colorType = NVTX_COLOR_ARGB; eventAttrib.color = argbColor; eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; eventAttrib.message.ascii = name.toUtf8().data(); eventAttrib.payload.llValue = payload; eventAttrib.payloadType = NVTX_PAYLOAD_TYPE_UNSIGNED_INT64; nvtxRangePushEx(&eventAttrib); #endif } }
inline Profiler::Slot Profiler::beginSection( const char* name, GPUInterface* gpuif ) { GLuint queryFrame = m_numFrames % FRAME_DELAY; Slot slot = m_frameEntries++; if (slot >= m_entries.size()){ grow((unsigned int)(m_entries.size() * 2)); if (gpuif){ gpuif->TimerGrow( getRequiredTimers() ); } } if (m_entries[slot].name != name || m_entries[slot].gpuif != gpuif ) { m_entries[slot].name = name; m_entries[slot].gpuif = gpuif; m_resetDelay = CONFIG_DELAY; } int level = m_level++; m_entries[slot].level = level; m_entries[slot].splitter = false; #ifdef SUPPORT_NVTOOLSEXT { nvtxEventAttributes_t eventAttrib = {0}; eventAttrib.version = NVTX_VERSION; eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; eventAttrib.colorType = NVTX_COLOR_ARGB; unsigned char color[4]; color[0] = 255; color[1] = 0; color[2] = slot % 2 ? 127 : 255; color[3] = 255; color[2] -= level * 16; color[3] -= level * 16; eventAttrib.color = *(uint32_t*)(color); eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; eventAttrib.message.ascii = name; nvtxRangePushEx(&eventAttrib); } #endif if (gpuif){ gpuif->TimerSetup( getTimerIdx(slot,queryFrame,true) ); } else{ glQueryCounter(m_entries[slot].queries[queryFrame],GL_TIMESTAMP); } m_entries[slot].deltas[queryFrame] = -getMicroSeconds(); return slot; }
void nvtx_push(const char *name) { nvtxEventAttributes_t e; memset(&e, 0, sizeof(e)); e.version = NVTX_VERSION; e.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; e.colorType = NVTX_COLOR_ARGB; e.color = str2color(name); e.messageType = NVTX_MESSAGE_TYPE_ASCII; e.message.ascii = name; nvtxRangePushEx(&e); }
ProfileRange::ProfileRange(const char *name, uint32_t argbColor, uint64_t payload) { nvtxEventAttributes_t eventAttrib = {0}; eventAttrib.version = NVTX_VERSION; eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; eventAttrib.colorType = NVTX_COLOR_ARGB; eventAttrib.color = argbColor; eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; eventAttrib.message.ascii = name; eventAttrib.payload.llValue = payload; eventAttrib.payloadType = NVTX_PAYLOAD_TYPE_UNSIGNED_INT64; //_rangeId = nvtxRangeStartEx(&eventAttrib); _rangeId = nvtxRangePushEx(&eventAttrib); }