logging: Prefix internal functions with z_

There are 2 function in log_internal that were not prefixed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-09-15 07:17:23 +02:00 committed by Christopher Friedt
commit abf8c741e4
5 changed files with 23 additions and 23 deletions

View file

@ -40,7 +40,7 @@ bool z_log_dropped_pending(void);
*
* @param buf Buffer.
*/
void log_free(void *buf);
void z_log_free(void *buf);
/* Initialize runtime filters */
void z_log_runtime_filters_init(void);
@ -54,13 +54,13 @@ void z_log_notify_backend_enabled(void);
*
* @return Pointer to the filter set.
*/
static inline uint32_t *log_dynamic_filters_get(uint32_t source_id)
static inline uint32_t *z_log_dynamic_filters_get(uint32_t source_id)
{
return &__log_dynamic_start[source_id].filters;
}
/** @brief Get number of registered sources. */
static inline uint32_t log_sources_count(void)
static inline uint32_t z_log_sources_count(void)
{
return log_const_source_id(__log_const_end);
}

View file

@ -93,7 +93,7 @@ static int log_status(const struct shell *shell,
const struct log_backend *backend,
size_t argc, char **argv)
{
uint32_t modules_cnt = log_sources_count();
uint32_t modules_cnt = z_log_sources_count();
uint32_t dynamic_lvl;
uint32_t compiled_lvl;
@ -141,7 +141,7 @@ static int cmd_log_backend_status(const struct shell *shell,
static int module_id_get(const char *name)
{
uint32_t modules_cnt = log_sources_count();
uint32_t modules_cnt = z_log_sources_count();
const char *tmp_name;
uint32_t i;
@ -162,7 +162,7 @@ static void filters_set(const struct shell *shell,
int i;
int id;
bool all = argc ? false : true;
int cnt = all ? log_sources_count() : argc;
int cnt = all ? z_log_sources_count() : argc;
if (!backend->cb->active) {
shell_warn(shell, "Backend not active.");

View file

@ -931,7 +931,7 @@ bool log_is_strdup(const void *buf)
}
void log_free(void *str)
void z_log_free(void *str)
{
struct log_strdup_buf *dup = CONTAINER_OF(str, struct log_strdup_buf,
buf);
@ -976,12 +976,12 @@ void z_vrfy_z_log_string_from_user(uint32_t src_level_val, const char *str)
"Invalid log level"));
Z_OOPS(Z_SYSCALL_VERIFY_MSG(domain_id == CONFIG_LOG_DOMAIN_ID,
"Invalid log domain_id"));
Z_OOPS(Z_SYSCALL_VERIFY_MSG(source_id < log_sources_count(),
Z_OOPS(Z_SYSCALL_VERIFY_MSG(source_id < z_log_sources_count(),
"Invalid log source id"));
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) &&
(level != LOG_LEVEL_INTERNAL_RAW_STRING) &&
(level > LOG_FILTER_SLOT_GET(log_dynamic_filters_get(source_id),
(level > LOG_FILTER_SLOT_GET(z_log_dynamic_filters_get(source_id),
LOG_FILTER_AGGR_SLOT_IDX))) {
/* Skip filtered out messages. */
return;
@ -1074,12 +1074,12 @@ void z_vrfy_z_log_hexdump_from_user(uint32_t src_level_val, const char *metadata
src_level_union.structure.domain_id == CONFIG_LOG_DOMAIN_ID,
"Invalid log domain_id"));
Z_OOPS(Z_SYSCALL_VERIFY_MSG(
src_level_union.structure.source_id < log_sources_count(),
src_level_union.structure.source_id < z_log_sources_count(),
"Invalid log source id"));
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) &&
(src_level_union.structure.level > LOG_FILTER_SLOT_GET(
log_dynamic_filters_get(src_level_union.structure.source_id),
z_log_dynamic_filters_get(src_level_union.structure.source_id),
LOG_FILTER_AGGR_SLOT_IDX))) {
/* Skip filtered out messages. */
return;

View file

@ -33,8 +33,8 @@ void z_log_runtime_filters_init(void)
* compile-time level. When backends are attached later on in
* log_init(), they'll be initialized to the same value.
*/
for (int i = 0; i < log_sources_count(); i++) {
uint32_t *filters = log_dynamic_filters_get(i);
for (int i = 0; i < z_log_sources_count(); i++) {
uint32_t *filters = z_log_dynamic_filters_get(i);
uint8_t level = log_compiled_level_get(i);
LOG_FILTER_SLOT_SET(filters,
@ -45,7 +45,7 @@ void z_log_runtime_filters_init(void)
uint32_t log_src_cnt_get(uint32_t domain_id)
{
return log_sources_count();
return z_log_sources_count();
}
/** @brief Get name of the log source.
@ -60,7 +60,7 @@ static inline const char *log_name_get(uint32_t source_id)
const char *log_source_name_get(uint32_t domain_id, uint32_t src_id)
{
return src_id < log_sources_count() ? log_name_get(src_id) : NULL;
return src_id < z_log_sources_count() ? log_name_get(src_id) : NULL;
}
static uint32_t max_filter_get(uint32_t filters)
@ -84,12 +84,12 @@ uint32_t z_impl_log_filter_set(struct log_backend const *const backend,
uint32_t domain_id, int16_t source_id,
uint32_t level)
{
__ASSERT_NO_MSG(source_id < log_sources_count());
__ASSERT_NO_MSG(source_id < z_log_sources_count());
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING)) {
uint32_t new_aggr_filter;
uint32_t *filters = log_dynamic_filters_get(source_id);
uint32_t *filters = z_log_dynamic_filters_get(source_id);
if (backend == NULL) {
struct log_backend const *iter_backend;
@ -139,7 +139,7 @@ uint32_t z_vrfy_log_filter_set(struct log_backend const *const backend,
"Setting per-backend filters from user mode is not supported"));
Z_OOPS(Z_SYSCALL_VERIFY_MSG(domain_id == CONFIG_LOG_DOMAIN_ID,
"Invalid log domain_id"));
Z_OOPS(Z_SYSCALL_VERIFY_MSG(src_id < log_sources_count(),
Z_OOPS(Z_SYSCALL_VERIFY_MSG(src_id < z_log_sources_count(),
"Invalid log source id"));
Z_OOPS(Z_SYSCALL_VERIFY_MSG(
(level <= LOG_LEVEL_DBG),
@ -154,7 +154,7 @@ static void backend_filter_set(struct log_backend const *const backend,
uint32_t level)
{
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING)) {
for (int i = 0; i < log_sources_count(); i++) {
for (int i = 0; i < z_log_sources_count(); i++) {
log_filter_set(backend, CONFIG_LOG_DOMAIN_ID, i, level);
}
}
@ -185,14 +185,14 @@ void log_backend_disable(struct log_backend const *const backend)
uint32_t log_filter_get(struct log_backend const *const backend,
uint32_t domain_id, int16_t source_id, bool runtime)
{
__ASSERT_NO_MSG(source_id < log_sources_count());
__ASSERT_NO_MSG(source_id < z_log_sources_count());
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) && runtime) {
if (source_id < 0) {
return LOG_LEVEL_DBG;
}
uint32_t *filters = log_dynamic_filters_get(source_id);
uint32_t *filters = z_log_dynamic_filters_get(source_id);
return LOG_FILTER_SLOT_GET(filters,
log_backend_id_get(backend));

View file

@ -134,7 +134,7 @@ static void msg_free(struct log_msg *msg)
}
}
if (smask & BIT(i)) {
log_free(buf);
z_log_free(buf);
}
}
}
@ -147,7 +147,7 @@ static void msg_free(struct log_msg *msg)
const char *str = log_msg_str_get(msg);
if (log_is_strdup(str)) {
log_free((void *)(str));
z_log_free((void *)(str));
}
} else {
/* Message does not contain any arguments that might be a transient