Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit daae54f

Browse files
author
Thales Sabino
committed
LXCL: Fix tracing of Vulkan calls on Remote Agent
1 parent c74d7d8 commit daae54f

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed

CodeXL/Components/PowerProfiling/MiddleTier/AMDTPowerProfilingMidTier/src/LPGPU2_TraceDataPacketParser.cpp

+28-20
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,35 @@ PPFnStatus TraceDataPacketParser::ConsumeDataImpl(
8787
// No need to check as the API calls made by the app are necessarily
8888
// the ones available and listed in the TargetCharacteristics.xml
8989
const auto apiInfo = commands.apisLUT.find(apiID);
90-
assert(apiInfo != commands.apisLUT.end());
91-
const auto cmdInfoPtr = apiInfo->second.cmdsLUT.find(cmdID);
92-
assert(cmdInfoPtr != apiInfo->second.cmdsLUT.end());
93-
const auto &cmdInfo = cmdInfoPtr->second;
94-
95-
// Save the data in the database
96-
db::ProfileTraceInfo trace = {
97-
cmdID,
98-
cmdInfo.name,
99-
startTime,
100-
endTime,
101-
frameNumber,
102-
drawNumber,
103-
apiID,
104-
offset,
105-
length};
106-
auto rcDb = m_pDataAdapter->InsertProfileTraceInfo(trace);
107-
if (!rcDb)
90+
if (apiInfo != commands.apisLUT.end())
10891
{
109-
return PPFnStatus::failure;
110-
}
92+
assert(apiInfo != commands.apisLUT.end());
93+
const auto cmdInfoPtr = apiInfo->second.cmdsLUT.find(cmdID);
94+
95+
if (cmdInfoPtr != apiInfo->second.cmdsLUT.end())
96+
{
97+
assert(cmdInfoPtr != apiInfo->second.cmdsLUT.end());
98+
const auto &cmdInfo = cmdInfoPtr->second;
99+
100+
// Save the data in the database
101+
db::ProfileTraceInfo trace = {
102+
cmdID,
103+
cmdInfo.name,
104+
startTime,
105+
endTime,
106+
frameNumber,
107+
drawNumber,
108+
apiID,
109+
offset,
110+
length };
111+
112+
auto rcDb = m_pDataAdapter->InsertProfileTraceInfo(trace);
113+
if (!rcDb)
114+
{
115+
return PPFnStatus::failure;
116+
}
117+
}
118+
}
111119

112120
return PPFnStatus::success;
113121
}

0 commit comments

Comments
 (0)