// FIXME void Duration::endRange(const QLoggingCategory& category, uint64_t rangeId) { #ifdef NSIGHT_TRACING if (tracingEnabled() && category.isDebugEnabled()) { nvtxRangeEnd(rangeId); } #endif }
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 } }
// FIXME uint64_t Duration::beginRange(const QLoggingCategory& category, const char* name, uint32_t argbColor) { #ifdef NSIGHT_TRACING if (tracingEnabled() && category.isDebugEnabled()) { 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; return nvtxRangeStartEx(&eventAttrib); } #endif return 0; }
void toggleLogging(QString &category) { if(category.isEmpty()) return; QLoggingCategory *cat = nullptr; if(category.contains("logging",Qt::CaseInsensitive)) cat = &logLogging(); else if(category.contains("keybinds",Qt::CaseInsensitive)) cat = &logKeybinds(); else if(category.contains("settings",Qt::CaseInsensitive)) cat = &logSettings(); else if(category.contains("gui",Qt::CaseInsensitive)) cat = &logGUI(); else if(category.contains("teams",Qt::CaseInsensitive)) cat = &logTeams(); else if(category.contains("db",Qt::CaseInsensitive)) cat = &logDB(); else if(category.contains("input",Qt::CaseInsensitive)) cat = &logInput(); else if(category.contains("position",Qt::CaseInsensitive)) cat = &logPosition(); else if(category.contains("orientation",Qt::CaseInsensitive)) cat = &logOrientation(); else if(category.contains("movement",Qt::CaseInsensitive)) cat = &logMovement(); else if(category.contains("chat",Qt::CaseInsensitive)) cat = &logChat(); else if(category.contains("infomsg",Qt::CaseInsensitive)) cat = &logInfoMsg(); else if(category.contains("emotes",Qt::CaseInsensitive)) cat = &logEmotes(); else if(category.contains("target",Qt::CaseInsensitive)) cat = &logTarget(); else if(category.contains("spawn",Qt::CaseInsensitive)) cat = &logSpawn(); else if(category.contains("mapevents",Qt::CaseInsensitive)) cat = &logMapEvents(); else if (category.contains("mapxfers",Qt::CaseInsensitive)) cat = &logMapXfers(); else if(category.contains("slashcommand",Qt::CaseInsensitive)) cat = &logSlashCommand(); else if(category.contains("description",Qt::CaseInsensitive)) cat = &logDescription(); else if(category.contains("friends",Qt::CaseInsensitive)) cat = &logFriends(); else if(category.contains("minimap",Qt::CaseInsensitive)) cat = &logMiniMap(); else if(category.contains("lfg",Qt::CaseInsensitive)) cat = &logLFG(); else if(category.contains("npcs",Qt::CaseInsensitive)) cat = &logNPCs(); else if(category.contains("animations",Qt::CaseInsensitive)) cat = &logAnimations(); else if(category.contains("powers",Qt::CaseInsensitive)) cat = &logPowers(); else if(category.contains("trades",Qt::CaseInsensitive)) cat = &logTrades(); else if(category.contains("scripts", Qt::CaseInsensitive)) cat = &logScripts(); else if(category.contains("scenegraph",Qt::CaseInsensitive)) cat = &logSceneGraph(); else return; cat->setEnabled(QtDebugMsg, !cat->isDebugEnabled()); cat->setEnabled(QtInfoMsg, !cat->isInfoEnabled()); cat->setEnabled(QtWarningMsg, !cat->isWarningEnabled()); cat->setEnabled(QtCriticalMsg, !cat->isCriticalEnabled()); dumpLogging(); }