2021-01-31 19:41:17 -08:00
|
|
|
/*
|
|
|
|
* runtime_state.cpp
|
|
|
|
*
|
|
|
|
* Created on: Jan 31, 2021
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2021
|
|
|
|
*/
|
|
|
|
|
2021-08-03 19:05:01 -07:00
|
|
|
#include "pch.h"
|
2021-01-31 19:41:17 -08:00
|
|
|
#include "runtime_state.h"
|
|
|
|
|
|
|
|
// todo: revive implementation! we shall measure how far is actual execution timestamp from desired execution timestamp
|
|
|
|
uint32_t maxSchedulingPrecisionLoss = 0;
|
|
|
|
|
|
|
|
extern uint32_t maxLockedDuration;
|
|
|
|
extern uint32_t maxEventCallbackDuration;
|
|
|
|
extern uint32_t triggerMaxDuration;
|
2022-09-13 11:07:25 -07:00
|
|
|
|
|
|
|
extern int maxTriggerReentrant;
|
2021-01-31 19:41:17 -08:00
|
|
|
|
|
|
|
#if EFI_PROD_CODE
|
|
|
|
extern uint32_t maxPrecisionCallbackDuration;
|
2022-11-18 18:39:05 -08:00
|
|
|
#endif // EFI_PROD_CODE
|
2021-01-31 19:41:17 -08:00
|
|
|
|
|
|
|
extern uint32_t maxSchedulingPrecisionLoss;
|
|
|
|
|
|
|
|
void resetMaxValues() {
|
2022-04-16 14:07:57 -07:00
|
|
|
#if (EFI_PROD_CODE || EFI_SIMULATOR) && EFI_SHAFT_POSITION_INPUT
|
2021-01-31 19:41:17 -08:00
|
|
|
maxEventCallbackDuration = triggerMaxDuration = 0;
|
2022-11-18 18:39:05 -08:00
|
|
|
#endif // EFI_PROD_CODE || EFI_SIMULATOR
|
2021-01-31 19:41:17 -08:00
|
|
|
|
|
|
|
maxSchedulingPrecisionLoss = 0;
|
|
|
|
|
|
|
|
#if EFI_CLOCK_LOCKS
|
|
|
|
maxLockedDuration = 0;
|
2022-11-18 18:39:05 -08:00
|
|
|
#endif // EFI_CLOCK_LOCKS
|
2021-01-31 19:41:17 -08:00
|
|
|
|
|
|
|
#if EFI_PROD_CODE
|
|
|
|
maxPrecisionCallbackDuration = 0;
|
2022-11-18 18:39:05 -08:00
|
|
|
#endif // EFI_PROD_CODE
|
2021-01-31 19:41:17 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void printRuntimeStats(void) {
|
2021-04-19 05:11:59 -07:00
|
|
|
efiPrintf("maxSchedulingPrecisionLoss=%d", maxSchedulingPrecisionLoss);
|
2021-01-31 19:41:17 -08:00
|
|
|
|
|
|
|
#if EFI_CLOCK_LOCKS
|
2021-12-01 22:06:40 -08:00
|
|
|
efiPrintf("maxLockedDuration=%d / maxTriggerReentrant=%d", maxLockedDuration, maxTriggerReentrant);
|
2022-11-18 18:39:05 -08:00
|
|
|
#endif // EFI_CLOCK_LOCKS
|
2021-01-31 19:41:17 -08:00
|
|
|
|
2021-04-19 05:11:59 -07:00
|
|
|
efiPrintf("maxEventCallbackDuration=%d", maxEventCallbackDuration);
|
2021-01-31 19:41:17 -08:00
|
|
|
}
|