logging: Add strdup current use to shell cmd

Add the number of strdup buffers currently in use to the
`log strdup_utilization` shell command.

Signed-off-by: Andrew Hedin <andrew.hedin@lairdconnect.com>
This commit is contained in:
Andrew Hedin 2021-06-01 16:04:31 -05:00 committed by Christopher Friedt
commit b52ad8f3e1
3 changed files with 16 additions and 0 deletions

View file

@ -904,6 +904,13 @@ char *z_log_strdup(const char *str)
return dup->buf;
}
uint32_t log_get_strdup_pool_current_utilization(void)
{
return IS_ENABLED(CONFIG_LOG_STRDUP_POOL_PROFILING) ?
log_strdup_in_use : 0;
}
uint32_t log_get_strdup_pool_utilization(void)
{
return IS_ENABLED(CONFIG_LOG_STRDUP_POOL_PROFILING) ?