mirror of https://github.com/rusefi/rusefi-1.git
trace global lock/unlock (#1582)
* trace global lock/unlock * bootloader stub * add to java Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
3f5ce01245
commit
38d3641c00
|
@ -34,4 +34,6 @@ void irqEnterHook() {}
|
|||
void irqExitHook() {}
|
||||
void contextSwitchHook() {}
|
||||
void threadInitHook(void*) {}
|
||||
void onLockHook() {}
|
||||
void onUnlockHook() {}
|
||||
//#endif /* ENABLE_PERF_TRACE */
|
|
@ -22,29 +22,15 @@ extern "C"
|
|||
void irqExitHook(void);
|
||||
void contextSwitchHook(void);
|
||||
void threadInitHook(void* tp);
|
||||
void onLockHook(void);
|
||||
void onUnlockHook(void);
|
||||
#endif /* __ASSEMBLER__ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if EFI_CLOCK_LOCKS
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
#ifndef __ASSEMBLER__
|
||||
void onLockHook(void);
|
||||
void onUnlockHook(void);
|
||||
#endif /* __ASSEMBLER__ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#define ON_LOCK_HOOK onLockHook()
|
||||
#define ON_UNLOCK_HOOK onUnlockHook()
|
||||
#else /* EFI_CLOCK_LOCKS */
|
||||
#define ON_LOCK_HOOK
|
||||
#define ON_UNLOCK_HOOK
|
||||
#endif /* EFI_CLOCK_LOCKS */
|
||||
#define ON_LOCK_HOOK onLockHook()
|
||||
#define ON_UNLOCK_HOOK onUnlockHook()
|
||||
|
||||
#if !defined(_FROM_ASM_)
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "engine.h"
|
||||
#include "os_access.h"
|
||||
#include "perf_trace.h"
|
||||
|
||||
static char warningBuffer[ERROR_BUFFER_SIZE];
|
||||
static critical_msg_t criticalErrorMessageBuffer;
|
||||
|
@ -205,11 +206,18 @@ uint32_t maxLockedDuration = 0;
|
|||
+#define _dbg_leave_lock() {ON_UNLOCK_HOOK;(ch.dbg.lock_cnt = (cnt_t)0);}
|
||||
#endif
|
||||
*/
|
||||
#endif /* EFI_CLOCK_LOCKS */
|
||||
|
||||
void onLockHook(void) {
|
||||
perfEventInstantGlobal(PE::GlobalLock);
|
||||
|
||||
#if EFI_CLOCK_LOCKS
|
||||
lastLockTime = getTimeNowLowerNt();
|
||||
#endif /* EFI_CLOCK_LOCKS */
|
||||
}
|
||||
|
||||
void onUnlockHook(void) {
|
||||
#if EFI_CLOCK_LOCKS
|
||||
uint32_t lockedDuration = getTimeNowLowerNt() - lastLockTime;
|
||||
if (lockedDuration > maxLockedDuration) {
|
||||
maxLockedDuration = lockedDuration;
|
||||
|
@ -218,10 +226,11 @@ void onUnlockHook(void) {
|
|||
// // un-comment this if you want a nice stop for a breakpoint
|
||||
// maxLockedDuration = lockedDuration + 1;
|
||||
// }
|
||||
}
|
||||
|
||||
#endif /* EFI_CLOCK_LOCKS */
|
||||
|
||||
perfEventInstantGlobal(PE::GlobalUnlock);
|
||||
}
|
||||
|
||||
void firmwareError(obd_code_e code, const char *fmt, ...) {
|
||||
#if EFI_PROD_CODE
|
||||
if (hasFirmwareErrorFlag)
|
||||
|
|
|
@ -60,6 +60,8 @@ enum class PE : uint8_t {
|
|||
EngineSniffer,
|
||||
PrepareIgnitionSchedule,
|
||||
Hip9011IntHoldCallback,
|
||||
GlobalLock,
|
||||
GlobalUnlock,
|
||||
// enum_end_tag
|
||||
// The tag above is consumed by PerfTraceTool.java
|
||||
// please note that the tool requires a comma at the end of last value
|
||||
|
|
|
@ -48,5 +48,7 @@ public class EnumNames {
|
|||
"EngineSniffer",
|
||||
"PrepareIgnitionSchedule",
|
||||
"Hip9011IntHoldCallback",
|
||||
"GlobalLock",
|
||||
"GlobalUnlock",
|
||||
};
|
||||
}
|
||||
|
|
|
@ -39,8 +39,6 @@
|
|||
#define BOARD_MC33972_COUNT 0
|
||||
#define BOARD_TLE8888_COUNT 0
|
||||
|
||||
#define EFI_CLOCK_LOCKS FALSE
|
||||
|
||||
#define EFI_FSIO TRUE
|
||||
|
||||
#define EFI_TEXT_LOGGING TRUE
|
||||
|
|
Loading…
Reference in New Issue