- unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag);
- traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId);
- }
- else
- {
- unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag);
- traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId);
+ if(start)
+ {
+ unsigned short contextId = traceManagerGeneric->mPerformanceInterface->GetContextId(tag);
+ if(!contextId)
+ {
+ contextId = traceManagerGeneric->mPerformanceInterface->AddContext(tag);
+ }
+ traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::START, contextId);
+ }
+ else
+ {
+ unsigned short contextId = traceManagerGeneric->mPerformanceInterface->GetContextId(tag);
+ traceManagerGeneric->mPerformanceInterface->AddMarker(PerformanceInterface::END, contextId);
+ }