diff --git a/logging/nxscope/Kconfig b/logging/nxscope/Kconfig index 85dd4f0e8..3649b25e9 100644 --- a/logging/nxscope/Kconfig +++ b/logging/nxscope/Kconfig @@ -52,4 +52,12 @@ config LOGGING_NXSCOPE_CRICHANNELS ---help--- Enable the support for non-buffered critical channels +config LOGGING_NXSCOPE_DISABLE_PUTLOCK + bool "NxScope disable lock in channels put interfaces" + default n + ---help--- + This option disables lock in channels put interfaces. + In that case, the user is responsible for ensuring + thread-safe operations with nxscope_lock/nxscope_unlock functions. + endif # LOGGING_NXSCOPE diff --git a/logging/nxscope/nxscope_chan.c b/logging/nxscope/nxscope_chan.c index cd8da2c6b..eac54897c 100644 --- a/logging/nxscope/nxscope_chan.c +++ b/logging/nxscope/nxscope_chan.c @@ -457,7 +457,9 @@ static int nxscope_put_common_m(FAR struct nxscope_s *s, uint8_t type, DEBUGASSERT(s); +#ifndef CONFIG_LOGGING_NXSCOPE_DISABLE_PUTLOCK nxscope_lock(s); +#endif /* Validate data */ @@ -506,7 +508,9 @@ static int nxscope_put_common_m(FAR struct nxscope_s *s, uint8_t type, #endif errout: +#ifndef CONFIG_LOGGING_NXSCOPE_DISABLE_PUTLOCK nxscope_unlock(s); +#endif return ret; }