%if EXISTS("_PROF_TLC_") == 0
%assign _PROF_TLC_ = 1
%function SLibProfilerSystemStart(system, sectionIdx) void
%openfile tmpBuff
%if SLibIsERTTarget()
%assign startSymbol = SLibTraceBegin(sectionIdx)
%<startSymbol>
%else
%assign startSymbol = FEVAL("coder.internal.getExecTimeProbeSymbol", "start")
%<startSymbol>(%<sectionIdx>);
%endif
%closefile tmpBuff
%return tmpBuff
%endfunction
%function SLibProfilerSystemFinish(system, sectionIdx) void
%openfile tmpBuff
%if SLibIsERTTarget()
%assign endSymbol = SLibTraceEnd(sectionIdx)
%<endSymbol>
%else
%assign endSymbol = FEVAL("coder.internal.getExecTimeProbeSymbol", "end")
%<endSymbol>(%<sectionIdx>);
%endif
%closefile tmpBuff
%return tmpBuff
%endfunction
%function SLibProfilerGetSectionIdx(fcnName) void
%assign sectionIdx = ...
FEVAL("coder.internal.requestExecTimeTraceId", ...
LibGetModelName(), fcnName)
%if ISEMPTY(sectionIdx) || (sectionIdx<=0)
%exit Failed to get identifier for execution profiling
%endif
%if SLibIsERTTarget()
%assign customTraceIdentifier = FEVAL("coder.internal.getExecTimeProbeSymbol", "customTraceIdentifier")
%assign rtnVal = SLibAddTrace("%<customTraceIdentifier>", "%<sectionIdx>")
%else
%assign rtnVal = SPRINTF("%dU",sectionIdx)
%endif
%return rtnVal
%endfunction
%function SLibProfilerTypeDefs() void
%assign declarationsSymbol = FEVAL("coder.internal.getExecTimeProbeSymbol", "declarations")
%openfile tmpBuff
/* %<declarationsSymbol> */
%closefile tmpBuff
%return tmpBuff
%endfunction
%endif