From 7d3ccd2877dd73a4932c320e2e0ad193a08ac36e Mon Sep 17 00:00:00 2001 From: David Cozens Date: Tue, 28 Jul 2026 23:00:37 +0100 Subject: [PATCH] feat: bring SolidSyslog into the build, nothing wired yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SolidSyslog enters the build and its lwIP adapter pack compiles against our lwipopts.h under our warning bar, but no application code calls into either yet. --gc-sections strips all of it, so the cost above the frozen baseline is 0 bytes on every axis — flash, RAM, heap, and both task stacks. That zero is the point: linking a platform pack you do not call is free, and the measurement is honest enough to show it. Three lines carry it. FetchContent nests the library under this build. SOLIDSYSLOG_PLATFORMS states the platforms rather than letting the library infer them from whatever the environment exports — lwIP alone, because nothing at this stage reaches any other pack. Then one link line for the Core library plus the pack. Getting to three lines took two fixes in the library, both found by this build being its first consumer from outside its own repository: it could not be used as a CMake subproject at all, and platform packs could only be selected by environment variables a real integrator would not have. Without the second, Core would also have shipped without its senders for a selection like this one. Pinned to a commit because the library has no release tag yet. Co-Authored-By: Claude Opus 5 (1M context) --- CMakeLists.txt | 15 ++++++++++++++- README.md | 11 +++++------ measurements/linked.csv | 6 +++--- measurements/stages.tsv | 1 + run-report.md | 12 ++++++------ 5 files changed, 29 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d8c8bf..3c79ec1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,19 @@ endif() set(FREERTOS_PORT_DIR "${FREERTOS_KERNEL_PATH}/portable/GCC/ARM_CM3") set(LWIP_CONTRIB_FREERTOS_DIR "${LWIP_DIR}/contrib/ports/freertos") +# --- SolidSyslog --------------------------------------------------------------- +# Naming the platforms is the whole of the selection; anything unnamed is off. +# https://docs.cososo.co.uk/solid-syslog/getting-started/#path-a--cmake-consumer +# Pinned to a commit until there is a release tag to pin to. +set(SOLIDSYSLOG_PLATFORMS "LwipRaw" CACHE STRING "" FORCE) + +include(FetchContent) +FetchContent_Declare(SolidSyslog + GIT_REPOSITORY https://github.com/cososo-ltd/solid-syslog.git + GIT_TAG e4bc54d23d8b46c7479f319886bc775e4e8f3fbd +) +FetchContent_MakeAvailable(SolidSyslog) + # --- stage FatFs so ff.h's `#include "ffconf.h"` resolves to our integrator config # GCC's "" lookup checks the including file's own directory first, so colocating # the upstream ff.c/ff.h/diskio.h with our ffconf.h is how our config wins. @@ -148,7 +161,7 @@ target_include_directories(baseline PRIVATE # library, or context struct sizes diverge between consumer and library. target_compile_definitions(baseline PRIVATE MBEDTLS_USER_CONFIG_FILE=${MBEDTLS_USER_CONFIG_HEADER}) -target_link_libraries(baseline PRIVATE mbedtls mbedx509 mbedcrypto) +target_link_libraries(baseline PRIVATE mbedtls mbedx509 mbedcrypto SolidSyslog SolidSyslog::LwipRaw) target_link_options(baseline PRIVATE -mcpu=cortex-m3 -mthumb diff --git a/README.md b/README.md index b4cf548..99cfbe3 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,14 @@ It builds on a baseline that simulates the sort of device you might be adding th measures itself: see [docs/baseline.md](docs/baseline.md) for what the baseline is, how the figures are made, and how to run it. -## This stage — Baseline +## This stage — Linked -The device before any of this: networking up, a filesystem mounted, and a mutual-TLS session held -to its broker. Two application tasks sit idle, ready to be occupied. - -Nothing is logged and nothing is sent. This is the thing every later figure is measured against. +SolidSyslog is in the build with the lwIP platform selected: the core library, plus the components +that integrate lwIP in raw mode. Nothing calls it yet, so the linker strips it all back out. -This is the baseline itself: Flash 350,308 B, RAM 111,192 B. +**Cost above baseline: Flash +0 B, RAM +0 B.** @@ -33,6 +31,7 @@ committed as [`run-report.md`](run-report.md), and rewritten by every stage. | Stage | What it gives you | Flash | RAM | |---|---|---|---| | Baseline | a device that already networks, stores, and holds an mTLS session — before any syslog | — | — | +| Linked | the core library and lwIP raw-mode networking, linked but not yet called | +0 | +0 | *Deltas are bytes above the baseline, which is itself Flash 350,308 B, RAM 111,192 B.* diff --git a/measurements/linked.csv b/measurements/linked.csv index 5db96dd..318fb86 100644 --- a/measurements/linked.csv +++ b/measurements/linked.csv @@ -4,10 +4,10 @@ flash_text,349992 flash_data,316 static_bss,110876 heap_used,4440 -mbedtls_peak,21324 -mbedtls_free,11444 +mbedtls_peak,21332 +mbedtls_free,11436 lwip_mem_free,7576 -lwip_pbufs_free,13 +lwip_pbufs_free,14 stack_log,120 stack_service,52 stack_harness,2840 diff --git a/measurements/stages.tsv b/measurements/stages.tsv index 16e467e..a09dee6 100644 --- a/measurements/stages.tsv +++ b/measurements/stages.tsv @@ -10,3 +10,4 @@ # Slugs, not numbers: a stage inserted mid-history would renumber every file # after it, and this history has already had one inserted. Baseline Baseline a device that already networks, stores, and holds an mTLS session — before any syslog +linked Linked the core library and lwIP raw-mode networking, linked but not yet called diff --git a/run-report.md b/run-report.md index a38b084..19a1519 100644 --- a/run-report.md +++ b/run-report.md @@ -1,4 +1,4 @@ -# solid-syslog-example — run (Baseline) +# solid-syslog-example — run (linked) ## Device (self-measured) @@ -13,8 +13,8 @@ [report] flash_data,316,316,0 [report] static_bss,110876,110876,0 [report] heap_used,4440,4440,0 -[report] mbedtls_peak,21340,21332,8 -[report] mbedtls_free,11428,11436,-8 +[report] mbedtls_peak,21328,21332,-4 +[report] mbedtls_free,11440,11436,4 [report] lwip_mem_free,7576,7576,0 [report] lwip_pbufs_free,14,14,0 [report] stack_log,120,120,0 @@ -49,15 +49,15 @@ (nothing — this device sends no records yet) ``` -## Self-check (vs measurements/Baseline.csv) +## Self-check (vs measurements/linked.csv) ```text OK flash_text: 349992 (expected 349992, Δ0) OK flash_data: 316 (expected 316, Δ0) OK static_bss: 110876 (expected 110876, Δ0) OK heap_used: 4440 (expected 4440, Δ0) - OK mbedtls_peak: 21340 (expected 21332, Δ8) - OK mbedtls_free: 11428 (expected 11436, Δ8) + OK mbedtls_peak: 21328 (expected 21332, Δ4) + OK mbedtls_free: 11440 (expected 11436, Δ4) OK lwip_mem_free: 7576 (expected 7576, Δ0) OK lwip_pbufs_free: 14 (expected 14, Δ0) OK stack_log: 120 (expected 120, Δ0)