Line |
Branch |
Decision |
Exec |
Source |
1 |
|
|
|
/* |
2 |
|
|
|
* runtime_state.cpp |
3 |
|
|
|
* |
4 |
|
|
|
* Created on: Jan 31, 2021 |
5 |
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2021 |
6 |
|
|
|
*/ |
7 |
|
|
|
|
8 |
|
|
|
#include "pch.h" |
9 |
|
|
|
#include "runtime_state.h" |
10 |
|
|
|
|
11 |
|
|
|
// todo: revive implementation! we shall measure how far is actual execution timestamp from desired execution timestamp |
12 |
|
|
|
uint32_t maxSchedulingPrecisionLoss = 0; |
13 |
|
|
|
|
14 |
|
|
|
extern uint32_t maxLockedDuration; |
15 |
|
|
|
extern uint32_t maxEventCallbackDuration; |
16 |
|
|
|
extern uint32_t triggerMaxDuration; |
17 |
|
|
|
|
18 |
|
|
|
extern int maxTriggerReentrant; |
19 |
|
|
|
|
20 |
|
|
|
#if EFI_PROD_CODE |
21 |
|
|
|
extern uint32_t maxPrecisionCallbackDuration; |
22 |
|
|
|
#endif // EFI_PROD_CODE |
23 |
|
|
|
|
24 |
|
|
|
extern uint32_t maxSchedulingPrecisionLoss; |
25 |
|
|
|
|
26 |
|
|
✗ |
void resetMaxValues() { |
27 |
|
|
|
#if (EFI_PROD_CODE || EFI_SIMULATOR) && EFI_SHAFT_POSITION_INPUT |
28 |
|
|
|
maxEventCallbackDuration = triggerMaxDuration = 0; |
29 |
|
|
|
#endif // EFI_PROD_CODE || EFI_SIMULATOR |
30 |
|
|
|
|
31 |
|
|
✗ |
maxSchedulingPrecisionLoss = 0; |
32 |
|
|
|
|
33 |
|
|
|
#if EFI_CLOCK_LOCKS |
34 |
|
|
|
maxLockedDuration = 0; |
35 |
|
|
|
#endif // EFI_CLOCK_LOCKS |
36 |
|
|
|
|
37 |
|
|
|
#if EFI_PROD_CODE |
38 |
|
|
|
maxPrecisionCallbackDuration = 0; |
39 |
|
|
|
#endif // EFI_PROD_CODE |
40 |
|
|
✗ |
} |
41 |
|
|
|
|
42 |
|
|
✗ |
void printRuntimeStats(void) { |
43 |
|
|
✗ |
efiPrintf("maxSchedulingPrecisionLoss=%lu", maxSchedulingPrecisionLoss); |
44 |
|
|
|
|
45 |
|
|
|
#if EFI_CLOCK_LOCKS |
46 |
|
|
|
efiPrintf("maxLockedDuration=%lu / maxTriggerReentrant=%d", maxLockedDuration, maxTriggerReentrant); |
47 |
|
|
|
#endif // EFI_CLOCK_LOCKS |
48 |
|
|
|
|
49 |
|
|
✗ |
efiPrintf("maxEventCallbackDuration=%lu", maxEventCallbackDuration); |
50 |
|
|
✗ |
} |
51 |
|
|
|
|