feat(ke): integrate the logger with KConfig

This commit is contained in:
Loïc Grégoire
2026-03-28 10:17:18 -04:00
parent d3164b3824
commit 2e82a695e1
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -57,4 +57,9 @@ config NCPUS
help
This option sets the maximum number of CPUs the kernel can support.
config LOG_BUFFER_SHIFT
int "Log buffer size shift"
default 14
help
This option sets the size of the kernel log buffer as a power of two. The actual size is calculated as 2 raised to the power of this value (i.e., 2^LOG_BUFFER_SHIFT bytes).
endmenu
+5 -1
View File
@@ -4,6 +4,7 @@ const rtl = @import("rtl");
const pl = b.pl;
const ke = b.ke;
const ki = ke.private;
const config = @import("config");
const DebugWriter = struct {
interface: std.Io.Writer,
@@ -31,7 +32,10 @@ const DebugWriter = struct {
}
};
var ringbuffer = ki.log_ring.RingBuffer(14, 5).init();
// Messages are on average 2^5 = 32 bytes.
const avg_msg_size_bits = 5;
var ringbuffer = ki.log_ring.RingBuffer(config.CONFIG_LOG_BUFFER_SHIFT, avg_msg_size_bits).init();
pub fn log(
comptime level: std.log.Level,