Contenuto principale

Profilazione del tempo di esecuzione del codice

Visualizzare e analizzare i profili del tempo di esecuzione delle sezioni di codice

Utilizzare la profilazione del tempo di esecuzione per:

  • Verificare se il codice generato soddisfa i requisiti in tempo reale dell'hardware target.

  • Determinare le sezioni di codice che richiedono miglioramenti in termini di prestazioni.

È possibile configurare simulazioni Software-In-the-Loop (SIL), Processor-In-the-Loop (PIL) o in modalità esterna basata su XCP per ottenere metriche relative al tempo di esecuzione del codice generato. Utilizzare Code Profile Analyzer, il report sull'esecuzione del codice o Simulation Data Inspector per analizzare le metriche relative al tempo di esecuzione.

App

Code Profile AnalyzerAnalyze execution-time and stack usage profiles for generated code (Da R2023a)

Classi

espandi tutto

target.ProfilingFreezingOverheadCapture freezing and unfreezing instrumentation overhead
target.ProfilingFunctionOverheadCapture function instrumentation overhead
target.ProfilingTaskOverheadCapture task instrumentation overhead
target.TimerProvide timer details for processor

Oggetti

espandi tutto

coder.profile.ExecutionTimeSetAggregate code profiling results from multiple SIL, PIL, or external mode simulations (Da R2023b)
coder.profile.test.TestHookDefine custom callback functions for coder.profile.test.runTests (Da R2025a)

Funzioni

espandi tutto

annotateColor profiled model components or open model with profiled components colored
displayGenerate message that describes how to open code execution profiling report
ExecutionTimeInTicksGet execution times in timer ticks for profiled section of code
ExecutionTimeInSecondsGet execution time in seconds for profiled section of code
NameGet name of profiled code section
NumberGet number that uniquely identifies profiled code section
NumCallsTotal number of calls to profiled code section
scheduleVisualize task scheduling
SectionsGet array of coder.profile.ExecutionTimeSection objects for profiled code sections
SelfTimeInTicksGet number of timer ticks recorded for profiled code section, excluding time spent in child functions
TimeGet simulation time for code section
TimerTicksPerSecondGet and set number of timer ticks per second
TotalExecutionTimeInTicksGet total number of timer ticks recorded for profiled code section
TotalSelfTimeInTicksGet total number of timer ticks recorded for profiled code section, excluding time spent in child functions
TotalTurnaroundTimeInTicksGet total number of timer ticks between start and finish of the profiled code section over the entire simulation
TurnaroundTimeInTicksGet number of timer ticks between start and finish of the profiled code section
reportOpen code execution profiling report and specify display of time measurements
MaximumExecutionTimeCallNumGet the call number at which maximum number of timer ticks occurred
MaximumExecutionTimeInTicksGet maximum number of timer ticks for single invocation of profiled code section
MaximumSelfTimeInTicksGet the maximum number of timer ticks recorded for profiled code section, excluding time spent in child functions
MaximumTurnaroundTimeCallNum Get call number of the maximum number of timer ticks between start and finish of a single invocation of profiled code section
MaximumTurnaroundTimeInTicksGet maximum number of timer ticks between start and finish of a single invocation of profiled code section
coder.profile.test.runTestsAutomate execution-time or stack usage analysis of code generated from Simulink models or MATLAB functions (Da R2024a)
addAggregate execution-time profiles (Da R2023b)
addDetailsAdd text items to Code Profile Analyzer display or code profiling report (Da R2025a)
getExtract specific execution-time profile from aggregate of profiles (Da R2023b)
removeRemove execution-time profile from aggregate of profiles (Da R2023b)

Argomenti

Panoramiche sul workflow

Configurazione della profilazione e risultati