lib: os: cbprintf: Extend API to support new packaging modes

Added new flags to packaging API:
- CBPRINTF_PACKAGE_ADD_RO_STR_IDXS - when set, read-only string
  locations are appended to the package
- CBPRINTF_PACKAGE_ADD_RW_STR_IDXS - when set, read-write string
  locations are appended to the package (instead of appending actual
  strings)
- CBPRINTF_PACKAGE_FIRST_RO_STR_CNT(n) - indicate that n first strings
  are known to be read only. Ignored in runtime packaging.

Add function for copying packages with optional appending strings.

Changed CBPRINTF_MUST_RUNTIME_PACKAGE to use same flags as packaging.

Aligned logging and test to those changes.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-02-22 14:31:26 +01:00 committed by Carles Cufí
commit c917e6c2ce
10 changed files with 532 additions and 158 deletions

View file

@ -399,7 +399,7 @@ void z_log_vprintk(const char *fmt, va_list ap)
if (!IS_ENABLED(CONFIG_LOG1)) {
z_log_msg2_runtime_vcreate(CONFIG_LOG_DOMAIN_ID, NULL,
LOG_LEVEL_INTERNAL_RAW_STRING, NULL, 0,
LOG_LEVEL_INTERNAL_RAW_STRING, NULL, 0, 0,
fmt, ap);
return;
}