Spinlock Profiling
In this topic:
Spinlock Profiling utilizes the Vector OS Timing Hooks. It only works in combination with instrumented Task and ISR profiling.
Spinlock Profiling is an experimental feature and currently only works with data tracing. |
Spinlock profiling utilizes the OS Timing Hooks, which should already be enabled. If not, follow the section Task State and ISR Profiling via Instrumentation first, before continuing with this section.
For Spinlock profiling to work, two changes are necessary. First, in addition to the thread instrumentation, iTCHi also has to generate the Spinlock instrumentation into OS_TimingHooks_isystem.h. Second, iTCHi has to update the Profiler XML.
Open the iTCHi wizard, and load the existing itchi.json. |
Check task_state_instrumentation and spinlock_instrumentation command and |
If you haven’t configured task_state_instrumentation yet, do that first.
Press Next and make sure that spinlock_generate_instrumentation is selected. |
In the attribute configuration dialog, there is now a new area spinlock_instrumentation.
(optional) Override the definition of the spinlock trace variable. |
You can optionally use the attribute spinlock_trace_variable_definition to override the definition of the spinlock trace variable. You can use {{spinlock_trace_variable}} inside the definition string to be replaced by the attributed defined in spinlock_trace_variable.
Click Generate. |
After iTCHi has finished, carefully check the output to confirm that the instrumentation files have been written. If they have not been written because they already exist, delete or rename them and generate again. Rebuild your application as before. In winIDEA, make sure that the spinlock variable exists and that it changes in the watch window if real-time updates are enabled.
In the winIDEA Analyzer, open your existing Profiler configuration. In addition to Threads, also enable Spinlocks. Depending on your architecture, manually configure the hardware trace of the spinlock variable and start a new recording.