From a3bd1a6026d74ddb1fcdc77fb4c5d8fd6f3e9efa Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 3 Sep 2021 18:01:00 +0000 Subject: [PATCH] Merge "kata-logger: use a larger ipc buffer" GitOrigin-RevId: 2801cc0bbdf62bd9e468e0e14d04f8bf740e72ee --- apps/system/CMakeLists.txt | 1 + .../components/DebugConsole/kata-logger/src/lib.rs | 6 ++++-- apps/system/system.camkes | 11 +++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/system/CMakeLists.txt b/apps/system/CMakeLists.txt index d5c4776..f95f3a8 100644 --- a/apps/system/CMakeLists.txt +++ b/apps/system/CMakeLists.txt @@ -16,6 +16,7 @@ project(system) CAmkESAddImportPath(interfaces) +includeGlobalComponents() include(${CMAKE_CURRENT_LIST_DIR}/rust.cmake) RustAddLibrary( diff --git a/apps/system/components/DebugConsole/kata-logger/src/lib.rs b/apps/system/components/DebugConsole/kata-logger/src/lib.rs index 4e89f6e..9004f2c 100644 --- a/apps/system/components/DebugConsole/kata-logger/src/lib.rs +++ b/apps/system/components/DebugConsole/kata-logger/src/lib.rs @@ -3,7 +3,9 @@ use cstr_core::CStr; use log::{Metadata, Record}; -const MAX_MSG_LEN: usize = 256; +// TODO(sleffler): until we can copy directly into shared memory limit +// stack allocation (can be up to 4096). +const MAX_MSG_LEN: usize = 2048; pub struct KataLogger; @@ -128,7 +130,7 @@ mod tests { // NB: to run these sequentially use --test-threads=1; otherwise // cargo will use multiple threads and you will get failures from // multiple users of MSGS and the global logger; e.g. - // cargo +nightly test -- --test-threads=1 + // cargo test -- --test-threads=1 #[test] fn test_each_log_level_works() { diff --git a/apps/system/system.camkes b/apps/system/system.camkes index d20780a..726f73d 100644 --- a/apps/system/system.camkes +++ b/apps/system/system.camkes @@ -11,6 +11,7 @@ */ import ; +import ; import "interfaces/dataport_io.idl4"; import "interfaces/VectorCoreInterface.camkes"; @@ -81,10 +82,12 @@ assembly { from debug_console.uart_rx, to uart_driver.rx); // Connect the LoggerInterface to each component that needs to log - // to the console. - connection seL4RPCCall LoggerInterface(from process_manager.logger, - from ml_coordinator.logger, - to debug_console.logger); + // to the console. Note this allocates a 4KB shared memory region to + // each component and copies data between components. + connection seL4RPCOverMultiSharedData LoggerInterface( + from process_manager.logger, + from ml_coordinator.logger, + to debug_console.logger); // Connect the SeL4Debug interface of each component that needs access. connection seL4RPCCall SeL4DebugInterface(from debug_console.sel4debug,