Skip to content

Commit 1305429

Browse files
cjwinklhoferkartben
authored andcommitted
tests: logging: Allow LOG_PRINTK from user space
The commit '3b29b9fa3b4 (tests: logging: restore userspace testing, 2025-04-18)' set CONFIG_LOG_PRINTK=n which brakes the build on the platform 'ip_k66f'. Without CONFIG_LOG_PRINTK=n (dependency from CONFIG_USERSPACE=y) some tests in 'tests/subsys/logging/log_core_additional/logging.log_user' would not build. Remove this dependency so that LOG_PRINTK can also be used from user space, which is possible since '77925656ab8 (logging: Fix runtime message creation in user-mode thread, 2025-04-18)' and reset CONFIG_LOG_PRINTK=y. Fixes: #89067 Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
1 parent 71a329f commit 1305429

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

subsys/logging/Kconfig.processing

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ if !LOG_MODE_MINIMAL
77

88
config LOG_PRINTK
99
bool "Process printk messages"
10-
depends on !USERSPACE
1110
default y if PRINTK
1211
help
1312
If enabled, printk messages are redirected to the logging subsystem.

tests/subsys/logging/log_core_additional/log_user.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CONFIG_LOG_ALWAYS_RUNTIME=y
99
CONFIG_LOG_PROCESS_THREAD=n
1010
CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=1
1111
CONFIG_THREAD_MONITOR=y
12-
CONFIG_LOG_PRINTK=n
12+
CONFIG_LOG_PRINTK=y
1313
CONFIG_LOG_BLOCK_IN_THREAD=y
1414
CONFIG_MAIN_STACK_SIZE=4096
1515
CONFIG_STACK_SENTINEL=n

tests/subsys/logging/log_core_additional/src/log_test_user.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,12 @@ ZTEST_USER(test_log_core_additional, test_log_panic)
8383
log_panic();
8484
}
8585

86+
/* test LOG_PRINTK from user space */
87+
ZTEST_USER(test_log_core_additional, test_log_printk_from_user)
88+
{
89+
LOG_PRINTK("test_printk");
90+
while (log_process()) {
91+
}
92+
}
93+
8694
#endif /** CONFIG_USERSPACE **/

0 commit comments

Comments
 (0)