logging/nxscope: add an option to disable lock in channels put interfaces
With this option enabled the user can speed up adding a large amount of data to the stream buffer by minimizing the usage of the nxscope lock interface: nxscope_lock(&nxs->nxs); nxscope_put_vfloat(&nxs, 0, data0, 1); nxscope_put_vfloat(&nxs, 1, data1, 1); nxscope_put_vfloat(&nxs, 2, data2, 1); nxscope_put_vfloat(&nxs, 3, data3, 1); nxscope_unlock(&nxs->nxs);
This commit is contained in:
parent
a906a76734
commit
8726e530d5
@ -52,4 +52,12 @@ config LOGGING_NXSCOPE_CRICHANNELS
|
|||||||
---help---
|
---help---
|
||||||
Enable the support for non-buffered critical channels
|
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
|
endif # LOGGING_NXSCOPE
|
||||||
|
@ -457,7 +457,9 @@ static int nxscope_put_common_m(FAR struct nxscope_s *s, uint8_t type,
|
|||||||
|
|
||||||
DEBUGASSERT(s);
|
DEBUGASSERT(s);
|
||||||
|
|
||||||
|
#ifndef CONFIG_LOGGING_NXSCOPE_DISABLE_PUTLOCK
|
||||||
nxscope_lock(s);
|
nxscope_lock(s);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Validate data */
|
/* Validate data */
|
||||||
|
|
||||||
@ -506,7 +508,9 @@ static int nxscope_put_common_m(FAR struct nxscope_s *s, uint8_t type,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
#ifndef CONFIG_LOGGING_NXSCOPE_DISABLE_PUTLOCK
|
||||||
nxscope_unlock(s);
|
nxscope_unlock(s);
|
||||||
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user