summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-01-06 14:08:14 -0700
committerCommit Bot <commit-bot@chromium.org>2022-01-07 16:52:50 +0000
commit7af4a1cf9a38dd3d144d473b6a4ce05fa2e43e99 (patch)
treec4754b0e383e8895e96829a30068d88fb328acb9 /zephyr
parent794c7a2d82ee5b0aba34f00ac7912fb179f11c23 (diff)
downloadchrome-ec-7af4a1cf9a38dd3d144d473b6a4ce05fa2e43e99.tar.gz
zephyr: Add new config to log console msgs
Add new config CONFIG_PLATFORM_EC_CONSOLE_DEBUG, which if enabled will log all zephyr_print() messages (generally console logs), to printk also. Enable CONFIG_PLATFORM_EC_CONSOLE_DEBUG in drivers test. BRANCH=None BUG=None TEST=zmake -l DEBUG -j 1 configure --test zephyr/test/drivers Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I18c179ecdb90998a57c67ff71ef7369015de623c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3370950 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/Kconfig.console9
-rw-r--r--zephyr/shim/src/console.c2
-rw-r--r--zephyr/test/drivers/prj.conf1
3 files changed, 12 insertions, 0 deletions
diff --git a/zephyr/Kconfig.console b/zephyr/Kconfig.console
index 809c03c1e0..a8c2a9c22a 100644
--- a/zephyr/Kconfig.console
+++ b/zephyr/Kconfig.console
@@ -53,3 +53,12 @@ config PLATFORM_EC_HOSTCMD_CONSOLE_BUF_SIZE
modular arithmetic is used.
endif # PLATFORM_EC_HOSTCMD_CONSOLE
+
+menuconfig PLATFORM_EC_CONSOLE_DEBUG
+ bool "Console Debug"
+ depends on CONSOLE
+ default n
+ help
+ Write all zephyr_print() messages to printk() also. Not recommended
+ outside of tests.
+
diff --git a/zephyr/shim/src/console.c b/zephyr/shim/src/console.c
index f8b2af8125..6b8267935a 100644
--- a/zephyr/shim/src/console.c
+++ b/zephyr/shim/src/console.c
@@ -278,6 +278,8 @@ static void zephyr_print(const char *buff, size_t size)
shell_fprintf(shell_zephyr, SHELL_NORMAL, "%s", buff);
if (IS_ENABLED(CONFIG_PLATFORM_EC_HOSTCMD_CONSOLE))
console_buf_notify_chars(buff, size);
+ if (IS_ENABLED(CONFIG_PLATFORM_EC_CONSOLE_DEBUG))
+ printk("%s", buff);
}
}
diff --git a/zephyr/test/drivers/prj.conf b/zephyr/test/drivers/prj.conf
index fbfaac9171..2b069499a8 100644
--- a/zephyr/test/drivers/prj.conf
+++ b/zephyr/test/drivers/prj.conf
@@ -18,6 +18,7 @@ CONFIG_EXCEPTION_STACK_TRACE=y
CONFIG_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_OPTIMIZATIONS=y
+CONFIG_PLATFORM_EC_CONSOLE_DEBUG=y
CONFIG_PLATFORM_EC=y
CONFIG_CROS_EC=y