Tentative fixes for RT statistics.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@16175 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2023-03-21 10:34:22 +00:00
parent 7e0e4ea9bb
commit b3555769e7
2 changed files with 8 additions and 0 deletions

View File

@ -123,6 +123,9 @@ uint64_t __port_schedule_next(void) {
mpuSetRegionAddress(PORT_USE_GUARD_MPU_REGION, ntp->wabase); mpuSetRegionAddress(PORT_USE_GUARD_MPU_REGION, ntp->wabase);
#endif #endif
__trace_switch(ntp, otp);
__stats_ctxswc(ntp, otp);
return ((uint64_t)(uint32_t)otp << 32) | ((uint64_t)(uint32_t)ntp << 0); return ((uint64_t)(uint32_t)otp << 32) | ((uint64_t)(uint32_t)ntp << 0);
} }

View File

@ -160,6 +160,11 @@ void chInstanceObjectInit(os_instance_t *oip,
/* Setting up the caller as current thread.*/ /* Setting up the caller as current thread.*/
oip->rlist.current->state = CH_STATE_CURRENT; oip->rlist.current->state = CH_STATE_CURRENT;
#if CH_DBG_STATISTICS == TRUE
/* Starting measurement for this thread.*/
chTMStartMeasurementX(&oip->rlist.current->stats);
#endif
/* User instance initialization hook.*/ /* User instance initialization hook.*/
CH_CFG_OS_INSTANCE_INIT_HOOK(oip); CH_CFG_OS_INSTANCE_INIT_HOOK(oip);