Hauptinhalt

Profilierung der Code-Ausführungszeit

Anzeigen und Analysieren der Ausführungszeitprofile von Codeabschnitten

Mit der Profilierung der Ausführungszeit können Sie:

  • Ermitteln, ob der generierte Code die Echtzeitanforderungen Ihrer Zielhardware erfüllt.

  • Herausfinden, bei welchen Codeabschnitten Leistungsverbesserungen erforderlich sind.

Sie können Software-in-the-Loop- (SIL), Processor-in-the-Loop- (PIL) oder XCP-basierte Simulationen im externen Modus konfigurieren, um Ausführungszeit-Metriken für Ihren generierten Code zu erzeugen. Verwenden Sie den Code Profile Analyzer, den Code-Ausführungsbericht oder den Simulation Data Inspector, um die Ausführungszeit-Metriken zu analysieren.

Apps

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

Klassen

alle erweitern

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

Objekte

alle erweitern

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

Funktionen

alle erweitern

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 (Seit R2024a)
addAggregate execution-time profiles (Seit R2023b)
addDetailsAdd text items to Code Profile Analyzer display or code profiling report (Seit R2025a)
getExtract specific execution-time profile from aggregate of profiles (Seit R2023b)
removeRemove execution-time profile from aggregate of profiles (Seit R2023b)

Themen

Workflow-Überblicke

Profilierungskonfigurationen und Ergebnisse