Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging: Fixes in dependencies around dictionary frontend #75507

Merged
merged 4 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/zephyr/logging/log_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static inline char z_log_minimal_level_to_char(int level)
} \
\
bool is_user_context = k_is_user_context(); \
if (!IS_ENABLED(CONFIG_LOG_FRONTEND) && IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) && \
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) && \
!is_user_context && _level > Z_LOG_RUNTIME_FILTER((_dsource)->filters)) { \
break; \
} \
Expand Down Expand Up @@ -335,7 +335,7 @@ static inline char z_log_minimal_level_to_char(int level)
(const char *)(_data), (_len));\
break; \
} \
if (!IS_ENABLED(CONFIG_LOG_FRONTEND) && IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) && \
if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) && \
!is_user_context && (_level) > Z_LOG_RUNTIME_FILTER(filters)) { \
break; \
} \
Expand Down
2 changes: 1 addition & 1 deletion subsys/logging/Kconfig.filtering
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu "Logging levels filtering"

config LOG_RUNTIME_FILTERING
bool "Runtime filtering reconfiguration"
depends on !LOG_FRONTEND_ONLY && !LOG_MODE_MINIMAL
depends on !LOG_MODE_MINIMAL
help
Allow runtime configuration of maximal, independent severity
level for instance.
Expand Down
2 changes: 1 addition & 1 deletion subsys/logging/Kconfig.frontends
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu "Frontends"

config LOG_FRONTEND_DICT_UART
bool "UART dictionary frontend"
select LOG_DICTIONARY_DB
select LOG_DICTIONARY_SUPPORT
select MPSC_PBUF
depends on UART_ASYNC_API || UART_INTERRUPT_DRIVEN
imply LOG_FMT_SECTION
Expand Down
6 changes: 4 additions & 2 deletions subsys/logging/log_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ static bool frontend_runtime_filtering(const void *source, uint32_t level)
return true;
}

/* If only frontend is used and log got here it means that it was accepted. */
if (IS_ENABLED(CONFIG_LOG_FRONTEND_ONLY)) {
/* If only frontend is used and log got here it means that it was accepted
* unless userspace is enabled then runtime filtering is done here.
*/
if (!IS_ENABLED(CONFIG_USERSPACE) && IS_ENABLED(CONFIG_LOG_FRONTEND_ONLY)) {
return true;
}

Expand Down
12 changes: 6 additions & 6 deletions tests/subsys/logging/log_api/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ static void flush_log(void)
}
}

static bool frontend_only(void)
{
return NO_BACKENDS || IS_ENABLED(CONFIG_LOG_FRONTEND_ONLY);
}

static void log_setup(bool backend2_enable)
{
stamp = TIMESTAMP_INIT_VAL;
Expand All @@ -98,7 +103,7 @@ static void log_setup(bool backend2_enable)
test_source_id = log_source_id_get(STRINGIFY(test));
test2_source_id = log_source_id_get(STRINGIFY(test2));

if (NO_BACKENDS) {
if (frontend_only()) {
return;
}

Expand Down Expand Up @@ -222,11 +227,6 @@ ZTEST(test_log_api, test_log_various_messages)
#undef TEST_MSG_1
}

static bool frontend_only(void)
{
return NO_BACKENDS || IS_ENABLED(CONFIG_LOG_FRONTEND_ONLY);
}

/*
* Test is using 2 backends and runtime filtering is enabled. After first call
* filtering for backend2 is reduced to warning. It is expected that next INFO
Expand Down
Loading