Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: read
Expand Down
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 a8d39793fc40a40987268bccccefbdc44f26f0b8
)
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.
Expand Down Expand Up @@ -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
Expand Down
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,26 @@ 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.
SolidSyslog is linked into the application without any of it being called. The stage is broken out
for clarity: it separates getting the build to accept the library from getting the device to use
it, so anything that goes wrong here is a build problem and nothing else.

Nothing is logged and nothing is sent. This is the thing every later figure is measured against.
Three lines carry it. `FetchContent` nests the library under this build. `SOLIDSYSLOG_PLATFORMS`
names the platforms rather than letting the library infer them from the environment — lwIP alone,
because nothing at this stage reaches any other pack. Then one link line, for the core library and
that pack.

`--gc-sections` discards what nothing calls, so a platform pack that is linked but unused does not
reach the image.

For now you need only the core and a network platform. The library has no release tag yet, so the
pin is a commit.

<!-- STAGE-COST:START (generated by scripts/gen-cost-table.py — do not edit by hand) -->

This is the baseline itself: Flash 350,308 B, RAM 111,192 B.
**Cost above baseline: Flash +0 B, RAM +0 B.**

<!-- STAGE-COST:END -->

Expand All @@ -33,6 +43,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.*

Expand All @@ -45,3 +56,7 @@ This example's own code is [0BSD](LICENSE) — completely open, no conditions.
Third-party code keeps its own license: the vendored Arm SMSC9220 driver (`app/net/smsc9220/`) is
Apache-2.0 (see its `LICENSE`). FreeRTOS, lwIP, mbedTLS, and FatFs are consumed from the build
container under their own upstream licenses and are not redistributed here.

SolidSyslog is fetched at build time and is likewise not redistributed here. It is offered under
three alternative licenses, which its own
[LICENSE.md](https://github.com/cososo-ltd/solid-syslog/blob/main/LICENSE.md) sets out.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
4 changes: 2 additions & 2 deletions measurements/linked.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ flash_text,349992
flash_data,316
static_bss,110876
heap_used,4440
mbedtls_peak,21324
mbedtls_free,11444
mbedtls_peak,21280
mbedtls_free,11488
lwip_mem_free,7576
lwip_pbufs_free,13
stack_log,120
Expand Down
3 changes: 2 additions & 1 deletion measurements/stages.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
# out and says so rather than publishing a blank row.
#
# Slugs, not numbers: a stage inserted mid-history would renumber every file
# after it, and this history has already had one inserted.
# after it.
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
16 changes: 8 additions & 8 deletions run-report.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# solid-syslog-example — run (Baseline)
# solid-syslog-example — run (linked)

## Device (self-measured)

Expand All @@ -13,10 +13,10 @@
[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,21232,21332,-100
[report] mbedtls_free,11536,11436,100
[report] lwip_mem_free,7576,7576,0
[report] lwip_pbufs_free,14,14,0
[report] lwip_pbufs_free,13,14,-1
[report] stack_log,120,120,0
[report] stack_service,52,52,0
[report] stack_harness,2840,2840,0
Expand Down Expand Up @@ -49,17 +49,17 @@
(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: 21232 (expected 21280, Δ48)
OK mbedtls_free: 11536 (expected 11488, Δ48)
OK lwip_mem_free: 7576 (expected 7576, Δ0)
OK lwip_pbufs_free: 14 (expected 14, Δ0)
OK lwip_pbufs_free: 13 (expected 13, Δ0)
OK stack_log: 120 (expected 120, Δ0)
OK stack_service: 52 (expected 52, Δ0)
OK stack_harness: 2840 (expected 2840, Δ0)
Expand Down
Loading