| 100 | } |
| 101 | |
| 102 | void GpuTrace::RegisterContext(uint64_t hContext, uint64_t hDevice, uint32_t nodeOrdinal, uint32_t processId) |
| 103 | { |
| 104 | auto deviceIter = mDevices.find(hDevice); |
| 105 | if (deviceIter == mDevices.end()) { |
| 106 | return; |
| 107 | } |
| 108 | auto pDxgAdapter = deviceIter->second; |
| 109 | auto node = &mNodes[pDxgAdapter].emplace(nodeOrdinal, Node{}).first->second; |
| 110 | |
| 111 | // Sometimes there are duplicate start events, make sure that they say the same thing |
| 112 | DebugAssert(mContexts.find(hContext) == mContexts.end() || mContexts.find(hContext)->second.mNode == node); |
| 113 | |
| 114 | auto context = &mContexts.emplace(hContext, Context()).first->second; |
| 115 | context->mPacketTrace = nullptr; |
| 116 | context->mNode = node; |
| 117 | context->mParentContext = 0; |
| 118 | context->mIsParentContext = false; |
| 119 | context->mIsHwQueue = false; |
| 120 | |
| 121 | if (processId != 0) { |
| 122 | SetContextProcessId(context, processId); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | // HwQueue's are similar to Contexts, but are used with HWS nodes and use the |
| 127 | // following pattern: |
no test coverage detected