...
Anchor
CPU_CFG_INT_DIS_MEAS_EN
to 1 in cpu_cfg.h
. anchorThe measurement is started each time interrupts are disabled and ends when interrupts are re-enabled. The measurement keeps track of two values: a global interrupt disable time, and an interrupt disable time for each task. Therefore, it is possible to know how long a task disables interrupts, enabling the user to better optimize their code.anchor
OS_TCB
during a context switch (see OSTaskSwHook()
in os_cpu_c.c
and described in Chapter 8Chapter 8, “Context Switching” on page 149).The unit of measure for the measured time is in CPU_TS (timestamp) units. It is necessary to find out the resolution of the timer used to measure these timestamps. For example, if the timer used for the timestamp is incremented at 1 MHz then the resolution of CPU_TS
is 1 microsecond1 microsecond.
Anchor
Interrupt disable time is obviously greatly affected by the speed at which the processor accesses instructions and thus, the memory access speed. In this case, the hardware designer might have introduced wait states to memory accesses, which affects overall performance of the system. This may show up as unusually long interrupt disable times.