From d3cea24fb3423d8757ed6eac4e354962101719a2 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 18 Nov 2025 17:50:54 -0600 Subject: [PATCH 1/8] Enhance synctrace logging. Switched the maps to be indexed by the .Pointer (not a string) Grouped the lockCount, unlockCount ,and lastLock in an trackingEntry so we can detect unlocks of something that wasn't ever locked and excessive unlocks and also tracks the first time locked and the last unlock time. Added LogDangledLocks for debugging use. Added a panic handler to the Main so we can log out panics --- internal/sync/log.go | 154 +++++++++++++++++++++++++++------------ internal/sync/release.go | 4 + main.go | 8 ++ 3 files changed, 118 insertions(+), 48 deletions(-) diff --git a/internal/sync/log.go b/internal/sync/log.go index 36d0b29c8..41937430c 100644 --- a/internal/sync/log.go +++ b/internal/sync/log.go @@ -10,6 +10,7 @@ import ( "time" "github.com/jetkvm/kvm/internal/logging" + "github.com/rs/zerolog" ) @@ -47,103 +48,160 @@ func logTrack(callerSkip int) *zerolog.Logger { return &l } -func logLockTrack(i string) *zerolog.Logger { +func logLockTrack(ptr uintptr) *zerolog.Logger { l := logTrack(4). With(). - Str("index", i). + Str("ptr", fmt.Sprintf("%x", ptr)). Logger() return &l } -var ( - indexMu sync.Mutex - - lockCount map[string]int = make(map[string]int) - unlockCount map[string]int = make(map[string]int) - lastLock map[string]time.Time = make(map[string]time.Time) -) - type trackable interface { sync.Locker } -func getIndex(t trackable) string { - ptr := reflect.ValueOf(t).Pointer() - return fmt.Sprintf("%x", ptr) +type trackingEntry struct { + lockCount int + unlockCount int + firstLock time.Time + lastLock time.Time + lastUnlock time.Time } -func increaseLockCount(i string) { +var ( + indexMu sync.Mutex + tracking map[uintptr]*trackingEntry = make(map[uintptr]*trackingEntry) +) + +func getPointer(t trackable) uintptr { + return reflect.ValueOf(t).Pointer() +} + +func increaseLockCount(ptr uintptr) { indexMu.Lock() defer indexMu.Unlock() - if _, ok := lockCount[i]; !ok { - lockCount[i] = 0 - } - lockCount[i]++ - - if _, ok := lastLock[i]; !ok { - lastLock[i] = time.Now() + entry, ok := tracking[ptr] + if !ok { + entry = &trackingEntry{} + entry.firstLock = time.Now() + tracking[ptr] = entry } + entry.lockCount++ + entry.lastLock = time.Now() } -func increaseUnlockCount(i string) { +func increaseUnlockCount(ptr uintptr) { indexMu.Lock() - defer indexMu.Unlock() - if _, ok := unlockCount[i]; !ok { - unlockCount[i] = 0 + entry, ok := tracking[ptr] + if !ok { + entry = &trackingEntry{} + tracking[ptr] = entry + } + entry.unlockCount++ + entry.lastUnlock = time.Now() + delta := entry.lockCount - entry.unlockCount + indexMu.Unlock() + + if !ok { + logLockTrack(ptr).Warn().Interface("entry", entry).Msg("Unlock called without prior Lock") + } + + if delta < 0 { + logLockTrack(ptr).Warn().Interface("entry", entry).Msg("Unlock called more times than Lock") } - unlockCount[i]++ } func logLock(t trackable) { - i := getIndex(t) - increaseLockCount(i) - logLockTrack(i).Trace().Msg("locking mutex") + ptr := getPointer(t) + increaseLockCount(ptr) + logLockTrack(ptr).Trace().Msg("locking mutex") } func logUnlock(t trackable) { - i := getIndex(t) - increaseUnlockCount(i) - logLockTrack(i).Trace().Msg("unlocking mutex") + ptr := getPointer(t) + increaseUnlockCount(ptr) + logLockTrack(ptr).Trace().Msg("unlocking mutex") } func logTryLock(t trackable) { - i := getIndex(t) - logLockTrack(i).Trace().Msg("trying to lock mutex") + ptr := getPointer(t) + logLockTrack(ptr).Trace().Msg("trying to lock mutex") } func logTryLockResult(t trackable, l bool) { if !l { return } - i := getIndex(t) - increaseLockCount(i) - logLockTrack(i).Trace().Msg("locked mutex") + ptr := getPointer(t) + increaseLockCount(ptr) + logLockTrack(ptr).Trace().Msg("locked mutex") } func logRLock(t trackable) { - i := getIndex(t) - increaseLockCount(i) - logLockTrack(i).Trace().Msg("locking mutex for reading") + ptr := getPointer(t) + increaseLockCount(ptr) + logLockTrack(ptr).Trace().Msg("locking mutex for reading") } func logRUnlock(t trackable) { - i := getIndex(t) - increaseUnlockCount(i) - logLockTrack(i).Trace().Msg("unlocking mutex for reading") + ptr := getPointer(t) + increaseUnlockCount(ptr) + logLockTrack(ptr).Trace().Msg("unlocking mutex for reading") } func logTryRLock(t trackable) { - i := getIndex(t) - logLockTrack(i).Trace().Msg("trying to lock mutex for reading") + ptr := getPointer(t) + logLockTrack(ptr).Trace().Msg("trying to lock mutex for reading") } func logTryRLockResult(t trackable, l bool) { if !l { return } - i := getIndex(t) - increaseLockCount(i) - logLockTrack(i).Trace().Msg("locked mutex for reading") + ptr := getPointer(t) + increaseLockCount(ptr) + logLockTrack(ptr).Trace().Msg("locked mutex for reading") +} + +// You can all this function at any time to log any dangled locks currently tracked +// it's not an error for there to be open locks, but this can help identify any +// potential issues if called judiciously +func LogDangledLocks() { + defaultLogger.Info().Msgf("Checking %v tracked locks for dangles", len(tracking)) + + indexMu.Lock() + var issues []struct { + ptr uintptr + entry trackingEntry + } + for ptr, entry := range tracking { + if entry.lockCount != entry.unlockCount { + issues = append(issues, struct { + ptr uintptr + entry trackingEntry + }{ptr, *entry}) + } + } + indexMu.Unlock() + + defaultLogger.Info().Msgf("%v potential issues", len(issues)) + + for _, issue := range issues { + ptr := issue.ptr + entry := issue.entry + delta := entry.lockCount - entry.unlockCount + + failureType := "excess unlocks" + if delta > 0 { + failureType = "held locks" + } + + defaultLogger.Warn(). + Str("ptr", fmt.Sprintf("%x", ptr)). + Interface("entry", entry). + Int("delta", delta). + Msgf("dangled lock detected: %s", failureType) + } } diff --git a/internal/sync/release.go b/internal/sync/release.go index daec330eb..8931a278a 100644 --- a/internal/sync/release.go +++ b/internal/sync/release.go @@ -90,3 +90,7 @@ type Once struct { func (o *Once) Do(f func()) { o.mu.Do(f) } + +// logDangledLocks is a no-op in non-synctrace builds +func LogDangledLocks() { +} diff --git a/main.go b/main.go index 83d337d7c..ce9ef0ddc 100644 --- a/main.go +++ b/main.go @@ -30,6 +30,13 @@ func Main() { logger.Log().Msg("JetKVM Starting Up") + defer func() { + if r := recover(); r != nil { + logger.Panic().Interface("error", r).Msg("Received panic") + panic(r) // Re-panic to crash as usual + } + }() + checkFailsafeReason() if failsafeModeActive { procPrefix = "jetkvm: [app+failsafe]" @@ -170,6 +177,7 @@ func Main() { <-sigs logger.Log().Msg("JetKVM Shutting Down") + //if fuseServer != nil { // err := setMassStorageImage(" ") // if err != nil { From f5a83f68509595dc5d2443cd8e11bd7f754eb031 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 18 Nov 2025 18:21:10 -0600 Subject: [PATCH 2/8] Switch to traceable sync for most everything --- cloud.go | 11 +++++------ config.go | 4 ++-- display.go | 3 ++- failsafe.go | 2 +- hw.go | 2 +- internal/mdns/mdns.go | 3 ++- internal/native/native.go | 3 ++- internal/native/single.go | 2 +- internal/timesync/timesync.go | 3 ++- internal/usbgadget/hid_keyboard.go | 3 ++- internal/usbgadget/usbgadget.go | 3 ++- internal/usbgadget/utils.go | 3 ++- internal/websecure/store.go | 3 ++- native.go | 5 +++-- usb_mass_storage.go | 6 +++--- web_tls.go | 2 +- webrtc.go | 9 +++++---- 17 files changed, 38 insertions(+), 29 deletions(-) diff --git a/cloud.go b/cloud.go index c3de70139..3ea7fc667 100644 --- a/cloud.go +++ b/cloud.go @@ -8,18 +8,17 @@ import ( "fmt" "net/http" "net/url" - "sync" "time" + "github.com/jetkvm/kvm/internal/sync" + + "github.com/coder/websocket" "github.com/coder/websocket/wsjson" + "github.com/coreos/go-oidc/v3/oidc" + "github.com/gin-gonic/gin" "github.com/google/uuid" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - - "github.com/coreos/go-oidc/v3/oidc" - - "github.com/coder/websocket" - "github.com/gin-gonic/gin" "github.com/rs/zerolog" ) diff --git a/config.go b/config.go index a06febd56..d0964574c 100644 --- a/config.go +++ b/config.go @@ -5,13 +5,13 @@ import ( "fmt" "os" "strconv" - "strings" - "sync" "github.com/jetkvm/kvm/internal/confparser" "github.com/jetkvm/kvm/internal/logging" "github.com/jetkvm/kvm/internal/network/types" + "github.com/jetkvm/kvm/internal/sync" "github.com/jetkvm/kvm/internal/usbgadget" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) diff --git a/display.go b/display.go index 9b12ad433..050bb1e71 100644 --- a/display.go +++ b/display.go @@ -7,9 +7,10 @@ import ( "os" "strconv" "strings" - "sync" "time" + "github.com/jetkvm/kvm/internal/sync" + "github.com/prometheus/common/version" ) diff --git a/failsafe.go b/failsafe.go index af9fbe0a4..e88b5c9e2 100644 --- a/failsafe.go +++ b/failsafe.go @@ -3,9 +3,9 @@ package kvm import ( "os" "strings" - "sync" "github.com/jetkvm/kvm/internal/supervisor" + "github.com/jetkvm/kvm/internal/sync" ) const ( diff --git a/hw.go b/hw.go index f6ec57f5c..d544cf1cf 100644 --- a/hw.go +++ b/hw.go @@ -6,10 +6,10 @@ import ( "os/exec" "regexp" "strings" - "sync" "time" "github.com/jetkvm/kvm/internal/ota" + "github.com/jetkvm/kvm/internal/sync" ) func extractSerialNumber() (string, error) { diff --git a/internal/mdns/mdns.go b/internal/mdns/mdns.go index 2b954d45d..bf2949e49 100644 --- a/internal/mdns/mdns.go +++ b/internal/mdns/mdns.go @@ -5,9 +5,10 @@ import ( "net" "reflect" "strings" - "sync" "github.com/jetkvm/kvm/internal/logging" + "github.com/jetkvm/kvm/internal/sync" + pion_mdns "github.com/pion/mdns/v2" "github.com/rs/zerolog" "golang.org/x/net/ipv4" diff --git a/internal/native/native.go b/internal/native/native.go index 138a82ad0..dddc2c9da 100644 --- a/internal/native/native.go +++ b/internal/native/native.go @@ -2,9 +2,10 @@ package native import ( "os" - "sync" "time" + "github.com/jetkvm/kvm/internal/sync" + "github.com/Masterminds/semver/v3" "github.com/jetkvm/kvm/internal/diagnostics" "github.com/rs/zerolog" diff --git a/internal/native/single.go b/internal/native/single.go index 0782b28cf..240a348e7 100644 --- a/internal/native/single.go +++ b/internal/native/single.go @@ -1,6 +1,6 @@ package native -import "sync" +import "github.com/jetkvm/kvm/internal/sync" var ( instance *Native diff --git a/internal/timesync/timesync.go b/internal/timesync/timesync.go index 97cee97d8..088f53599 100644 --- a/internal/timesync/timesync.go +++ b/internal/timesync/timesync.go @@ -4,10 +4,11 @@ import ( "fmt" "os" "os/exec" - "sync" "time" "github.com/jetkvm/kvm/internal/network/types" + "github.com/jetkvm/kvm/internal/sync" + "github.com/rs/zerolog" ) diff --git a/internal/usbgadget/hid_keyboard.go b/internal/usbgadget/hid_keyboard.go index 274f0b6aa..221781171 100644 --- a/internal/usbgadget/hid_keyboard.go +++ b/internal/usbgadget/hid_keyboard.go @@ -5,9 +5,10 @@ import ( "context" "fmt" "os" - "sync" "time" + "github.com/jetkvm/kvm/internal/sync" + "github.com/rs/xid" "github.com/rs/zerolog" ) diff --git a/internal/usbgadget/usbgadget.go b/internal/usbgadget/usbgadget.go index f01ae09d4..e9d352c0b 100644 --- a/internal/usbgadget/usbgadget.go +++ b/internal/usbgadget/usbgadget.go @@ -6,10 +6,11 @@ import ( "context" "os" "path" - "sync" "time" "github.com/jetkvm/kvm/internal/logging" + "github.com/jetkvm/kvm/internal/sync" + "github.com/rs/zerolog" ) diff --git a/internal/usbgadget/utils.go b/internal/usbgadget/utils.go index 85bf1579d..7ec32a23b 100644 --- a/internal/usbgadget/utils.go +++ b/internal/usbgadget/utils.go @@ -9,9 +9,10 @@ import ( "path/filepath" "strconv" "strings" - "sync" "time" + "github.com/jetkvm/kvm/internal/sync" + "github.com/rs/zerolog" ) diff --git a/internal/websecure/store.go b/internal/websecure/store.go index ea7911c48..aed051ca4 100644 --- a/internal/websecure/store.go +++ b/internal/websecure/store.go @@ -6,7 +6,8 @@ import ( "os" "path" "strings" - "sync" + + "github.com/jetkvm/kvm/internal/sync" "github.com/rs/zerolog" ) diff --git a/native.go b/native.go index 3625b4fc0..e8a5fbbe5 100644 --- a/native.go +++ b/native.go @@ -2,12 +2,13 @@ package kvm import ( "os" - "sync" "time" - "github.com/Masterminds/semver/v3" "github.com/jetkvm/kvm/internal/diagnostics" "github.com/jetkvm/kvm/internal/native" + "github.com/jetkvm/kvm/internal/sync" + + "github.com/Masterminds/semver/v3" "github.com/pion/webrtc/v4/pkg/media" ) diff --git a/usb_mass_storage.go b/usb_mass_storage.go index 0f1f4b934..5f444debe 100644 --- a/usb_mass_storage.go +++ b/usb_mass_storage.go @@ -10,16 +10,16 @@ import ( "path" "path/filepath" "strings" - "sync" "syscall" "time" + "github.com/jetkvm/kvm/internal/sync" + "github.com/jetkvm/kvm/resource" + "github.com/gin-gonic/gin" "github.com/google/uuid" "github.com/pion/webrtc/v4" "github.com/psanford/httpreadat" - - "github.com/jetkvm/kvm/resource" ) func writeFile(path string, data string) error { diff --git a/web_tls.go b/web_tls.go index 07d10afa2..8376ba9a2 100644 --- a/web_tls.go +++ b/web_tls.go @@ -7,8 +7,8 @@ import ( "errors" "fmt" "net/http" - "sync" + "github.com/jetkvm/kvm/internal/sync" "github.com/jetkvm/kvm/internal/websecure" ) diff --git a/webrtc.go b/webrtc.go index 1405e6759..328b160ed 100644 --- a/webrtc.go +++ b/webrtc.go @@ -6,16 +6,17 @@ import ( "encoding/json" "net" "strings" - "sync" "time" - "github.com/coder/websocket" - "github.com/coder/websocket/wsjson" - "github.com/gin-gonic/gin" "github.com/jetkvm/kvm/internal/diagnostics" "github.com/jetkvm/kvm/internal/hidrpc" "github.com/jetkvm/kvm/internal/logging" + "github.com/jetkvm/kvm/internal/sync" "github.com/jetkvm/kvm/internal/usbgadget" + + "github.com/coder/websocket" + "github.com/coder/websocket/wsjson" + "github.com/gin-gonic/gin" "github.com/pion/ice/v4" "github.com/pion/webrtc/v4" "github.com/rs/zerolog" From 4777588a584d41ba4127c187d5fb03c46f334d2c Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 18 Nov 2025 19:15:14 -0600 Subject: [PATCH 3/8] More documentation --- DEVELOPMENT.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 9d3a4b624..5f8f70372 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -112,12 +112,16 @@ tail -f /var/log/jetkvm.log │ │ ├── cgo/ # C files for the native library (HDMI, Touchscreen, etc.) │ │ └── eez/ # EEZ Studio Project files (for Touchscreen) │ ├── network/ # Network implementation +│ ├── sync/ # Synchronization primatives with automatic logging (if synctrace enabled) │ ├── timesync/ # Time sync/NTP implementation │ ├── tzdata/ # Timezone data and generation │ ├── udhcpc/ # DHCP implementation │ ├── usbgadget/ # USB gadget │ ├── utils/ # SSH handling │ └── websecure/ # TLS certificate management +├── pkg/ # External packages that have customizations +│ ├── myip/ # Get public IP information +│ └── nmlite/ # Network link manager ├── resource/ # netboot iso and other resources ├── scripts/ # Bash shell scripts for building and deploying └── static/ # (react client build output) @@ -162,7 +166,7 @@ tail -f /var/log/jetkvm.log ```bash cd ui -npm install +npm ci ./dev_device.sh ``` @@ -195,9 +199,11 @@ ssh root@192.168.1.100 ps aux | grep jetkvm ### View live logs +The file + ```bash ssh root@192.168.1.100 -tail -f /var/log/jetkvm.log +tail -f /var/log/jetkvm* ``` ### Reset everything (if stuck) @@ -328,6 +334,28 @@ Or if you want to manually create the symlink use: mklink /d ui ..\eez\src\ui ``` +### Build is unstable even before you changed anything + +Make sure you clean up your _node_ modules and do an `npm ci` (**not** `npm i`) to ensure that you get the exact packages required by _package-lock.json_. This is especially important when switching branches! + +```bash +cd ui && rm -rf node_modules/ && npm ci && cd .. +``` + +If you are working on upgrades to the UI packages use this command to wipe the slate clean and get a new valid _package-lock.json_: + +```bash +cd ui && rm -rf node_modules/ package-lock.json && npm i && cd .. +``` + +### Device panics or becomes unresponsive + +You can also run the device-side _go_ code under a debug session to view the logs as the device is booting up and being used. To do this use the following command in your development command-line (where the IP is the JetKVM device's IP on your network) to see a very detailed `synctrace` of all mutex activity: + +```bash +./dev_deploy.sh -r --enable-sync-trace +``` + --- ## Next Steps From 866ef1dd8f31aec3e02cc8e8afe4219a4d3a630b Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 18 Nov 2025 19:19:50 -0600 Subject: [PATCH 4/8] Update internal/sync/log.go --- internal/sync/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/sync/log.go b/internal/sync/log.go index 41937430c..a78944236 100644 --- a/internal/sync/log.go +++ b/internal/sync/log.go @@ -165,7 +165,7 @@ func logTryRLockResult(t trackable, l bool) { logLockTrack(ptr).Trace().Msg("locked mutex for reading") } -// You can all this function at any time to log any dangled locks currently tracked +// You can call this function at any time to log any dangled locks currently tracked // it's not an error for there to be open locks, but this can help identify any // potential issues if called judiciously func LogDangledLocks() { From 47774f8823f78f8308c49a29d0dbdd349d758cf4 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 18 Nov 2025 19:21:31 -0600 Subject: [PATCH 5/8] Update DEVELOPMENT.md --- DEVELOPMENT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 5f8f70372..75f1f5208 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -199,7 +199,7 @@ ssh root@192.168.1.100 ps aux | grep jetkvm ### View live logs -The file +The file `/var/log/jetkvm*` contains the JetKVM logs. You can view live logs with: ```bash ssh root@192.168.1.100 From d21ac071c41de36bdf59335ba2577b9587cb3dfe Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 23 Dec 2025 16:20:14 -0600 Subject: [PATCH 6/8] Resolve merge issue. --- config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/config.go b/config.go index d0964574c..9a6b93abc 100644 --- a/config.go +++ b/config.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "strconv" + "strings" "github.com/jetkvm/kvm/internal/confparser" "github.com/jetkvm/kvm/internal/logging" From 74216634c514ed3c6fe116de3d9d79659564cb4f Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 23 Dec 2025 16:52:39 -0600 Subject: [PATCH 7/8] Applied review comments --- internal/sync/log.go | 8 +++----- internal/sync/release.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/sync/log.go b/internal/sync/log.go index a78944236..dbbc19cfa 100644 --- a/internal/sync/log.go +++ b/internal/sync/log.go @@ -105,10 +105,8 @@ func increaseUnlockCount(ptr uintptr) { indexMu.Unlock() if !ok { - logLockTrack(ptr).Warn().Interface("entry", entry).Msg("Unlock called without prior Lock") - } - - if delta < 0 { + logLockTrack(ptr).Warn().Interface("entry", entry).Msg("Unlock called without any prior Lock") + } else if delta < 0 { logLockTrack(ptr).Warn().Interface("entry", entry).Msg("Unlock called more times than Lock") } } @@ -166,7 +164,7 @@ func logTryRLockResult(t trackable, l bool) { } // You can call this function at any time to log any dangled locks currently tracked -// it's not an error for there to be open locks, but this can help identify any +// It is not an error for there to be open locks, but this can help identify any // potential issues if called judiciously func LogDangledLocks() { defaultLogger.Info().Msgf("Checking %v tracked locks for dangles", len(tracking)) diff --git a/internal/sync/release.go b/internal/sync/release.go index 8931a278a..1aef4705c 100644 --- a/internal/sync/release.go +++ b/internal/sync/release.go @@ -91,6 +91,6 @@ func (o *Once) Do(f func()) { o.mu.Do(f) } -// logDangledLocks is a no-op in non-synctrace builds +// LogDangledLocks is a no-op in non-synctrace builds func LogDangledLocks() { } From 5bbdba23f047d1bb491a09d74da4a479902c8da5 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Tue, 30 Dec 2025 17:50:14 -0600 Subject: [PATCH 8/8] Restore --enable-sync-trace option. --- scripts/dev_deploy.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/dev_deploy.sh b/scripts/dev_deploy.sh index fbe8bced7..215113da5 100755 --- a/scripts/dev_deploy.sh +++ b/scripts/dev_deploy.sh @@ -105,6 +105,11 @@ while [[ $# -gt 0 ]]; do RESET_USB_HID_DEVICE=true shift ;; + --enable-sync-trace) + ENABLE_SYNC_TRACE=1 + LOG_TRACE_SCOPES="${LOG_TRACE_SCOPES},synctrace" + shift + ;; --disable-docker) BUILD_IN_DOCKER=false shift @@ -142,6 +147,12 @@ while [[ $# -gt 0 ]]; do esac done +if [ "$ENABLE_SYNC_TRACE" = 1 ]; then + if [[ ! "$LOG_TRACE_SCOPES" =~ synctrace ]]; then + LOG_TRACE_SCOPES="${LOG_TRACE_SCOPES},synctrace" + fi +fi + source ${SCRIPT_PATH}/build_utils.sh # Verify required parameters