From 06360c291156c32bc07fd28e7d33c5a6618d3c0b Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Fri, 10 Jul 2020 21:16:36 -0700 Subject: [PATCH] guard perf track lock hooks (#1591) Co-authored-by: Matthew Kennedy --- firmware/controllers/core/error_handling.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/controllers/core/error_handling.cpp b/firmware/controllers/core/error_handling.cpp index 70e3ab60ed..a419aa3c95 100644 --- a/firmware/controllers/core/error_handling.cpp +++ b/firmware/controllers/core/error_handling.cpp @@ -209,7 +209,9 @@ uint32_t maxLockedDuration = 0; #endif /* EFI_CLOCK_LOCKS */ void onLockHook(void) { +#if ENABLE_PERF_TRACE perfEventInstantGlobal(PE::GlobalLock); +#endif /* ENABLE_PERF_TRACE */ #if EFI_CLOCK_LOCKS lastLockTime = getTimeNowLowerNt(); @@ -228,7 +230,9 @@ void onUnlockHook(void) { // } #endif /* EFI_CLOCK_LOCKS */ +#if ENABLE_PERF_TRACE perfEventInstantGlobal(PE::GlobalUnlock); +#endif /* ENABLE_PERF_TRACE */ } void firmwareError(obd_code_e code, const char *fmt, ...) {