Skip to content

feat: S08.03 slice 8 wire meta SD + FreeRtosSysUpTime adapter (#310)#311

Merged
DavidCozens merged 1 commit into
mainfrom
feat/freertos-meta-sd
May 10, 2026
Merged

feat: S08.03 slice 8 wire meta SD + FreeRtosSysUpTime adapter (#310)#311
DavidCozens merged 1 commit into
mainfrom
feat/freertos-meta-sd

Conversation

@DavidCozens

@DavidCozens DavidCozens commented May 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Wires the meta SD-ELEMENT (sequenceId, sysUpTime, language) into Example/FreeRtos/SingleTask/main.c alongside the slice-7 origin SD; new SolidSyslogFreeRtosSysUpTime platform adapter (uint64 intermediate, uint32_t wrap per RFC 3418 TimeTicks).
  • SolidSyslogStdAtomicOps linked into the Cortex-M3 ELF — _Atomic uint32_t inlines to LDREX/STREX, so no FreeRTOS-specific atomic-ops adapter was needed for this single-task example.
  • Untagged structured_data.feature (3 scenarios). FreeRTOS BDD sweep is now 6 features / 17 scenarios green (slice 7 baseline 5 / 14).

Closes #310.

Test plan

  • cmake --build --preset debug clean; all 6 host test executables green, including new SolidSyslogFreeRtosSysUpTimeTest (4 tests: zero, one, mid-range, UINT32_MAX boundary).
  • cmake --build --preset freertos-cross --target SolidSyslogFreeRtosSingleTask clean.
  • behave --tags='not @wip and not @freertoswip and @udp' Bdd/features/structured_data.feature: 3 of 3 pass.
  • Full FreeRTOS BDD sweep: 6 features / 17 scenarios pass / 29 skipped.
  • clang-format --dry-run --Werror on touched files: clean.
  • CI: build-linux-gcc, build-linux-clang, build-windows-msvc, sanitize-linux-gcc, coverage-linux-gcc, analyze-tidy, analyze-cppcheck, analyze-format, analyze-iwyu, integration-linux-openssl, integration-windows-openssl, bdd-linux-syslog-ng, bdd-windows-otel, bdd-freertos-qemu, build-freertos-host-tdd, build-freertos-target.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added FreeRTOS SysUpTime support for structured data logging
    • Integrated meta-structured-data fields (sequenceId, sysUpTime, language) into the FreeRTOS example application
    • Updated public API documentation for new SysUpTime callback functionality
  • Tests

    • Added unit test suite for SysUpTime retrieval validation

Review Change Stack

…eeRTOS example

Adds Platform/FreeRtos/SolidSyslogFreeRtosSysUpTime
(xTaskGetTickCount-backed, uint64 intermediate so the formula stays
correct at any configTICK_RATE_HZ; uint32 cast wraps per RFC 3418
TimeTicks). Wires SolidSyslogStdAtomicOps -> AtomicCounter -> MetaSd
into Example/FreeRtos/SingleTask/main.c alongside the slice-7
originSd, reusing Example/Common/ExampleLanguage_Get for the
language callback. StdAtomicOps inlines to LDREX/STREX on
Cortex-M3 + Thumb-2 — no FreeRTOS-specific atomic-ops adapter
needed for this single-task example.

Untags structured_data.feature (3 scenarios). FreeRTOS BDD sweep
goes from 5 features / 14 scenarios to 6 / 17.
@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bee6917c-f7c7-4f03-bf82-c8f7407ae2fb

📥 Commits

Reviewing files that changed from the base of the PR and between 11d4185 and 1747ed4.

📒 Files selected for processing (11)
  • Bdd/features/structured_data.feature
  • CLAUDE.md
  • DEVLOG.md
  • Example/FreeRtos/SingleTask/CMakeLists.txt
  • Example/FreeRtos/SingleTask/main.c
  • Platform/FreeRtos/Interface/SolidSyslogFreeRtosSysUpTime.h
  • Platform/FreeRtos/Source/SolidSyslogFreeRtosSysUpTime.c
  • Tests/FreeRtos/CMakeLists.txt
  • Tests/FreeRtos/SolidSyslogFreeRtosSysUpTimeTest.cpp
  • Tests/Support/FreeRtosFakes/Interface/FreeRtosTaskFake.h
  • Tests/Support/FreeRtosFakes/Source/FreeRtosTaskFake.c
💤 Files with no reviewable changes (1)
  • Bdd/features/structured_data.feature

📝 Walkthrough

Walkthrough

This PR wires the meta structured-data block (sysUpTime + language) into the FreeRTOS single-task example by introducing a new SolidSyslogFreeRtosSysUpTime platform adapter that converts FreeRTOS tick counts to RFC 3418 TimeTicks (hundredths-of-second). Test fakes are extended to mock tick counts, unit tests verify boundary and mid-range conversion correctness, and the main example task is updated to create and manage the meta SD alongside the existing origin SD.

Changes

FreeRTOS Meta Structured-Data with SysUpTime Adapter

Layer / File(s) Summary
Public Contracts & Declarations
Platform/FreeRtos/Interface/SolidSyslogFreeRtosSysUpTime.h, Tests/Support/FreeRtosFakes/Interface/FreeRtosTaskFake.h
SolidSyslogFreeRtosSysUpTime_Get() declared to return uint32_t hundredths-since-boot; FreeRtosTaskFake_SetTickCount() declared to control tick-count mocking in tests.
Test Support Infrastructure
Tests/Support/FreeRtosFakes/Source/FreeRtosTaskFake.c
FreeRtosTaskFake extended with tickCount state, reset clears it, FreeRtosTaskFake_SetTickCount() setter added, and xTaskGetTickCount() implemented to return the stored tick count.
SysUpTime Adapter Implementation
Platform/FreeRtos/Source/SolidSyslogFreeRtosSysUpTime.c
SolidSyslogFreeRtosSysUpTime_Get() computes elapsed time from xTaskGetTickCount() using 64-bit intermediate and formula 100 / configTICK_RATE_HZ to convert ticks to hundredths-of-second, then returns as uint32_t.
SysUpTime Unit Tests
Tests/FreeRtos/CMakeLists.txt, Tests/FreeRtos/SolidSyslogFreeRtosSysUpTimeTest.cpp
New CMake test target SolidSyslogFreeRtosSysUpTimeTest added; CppUTest suite verifies correct conversion for tick counts 0, 1, 12345, and UINT32_MAX.
Build Configuration & Example Wiring
Example/FreeRtos/SingleTask/CMakeLists.txt, Example/FreeRtos/SingleTask/main.c
CMakeLists adds SolidSyslogFreeRtosSysUpTime.c and ExampleLanguage.c to sources; main.c creates SolidSyslogStdAtomicOpsSolidSyslogAtomicCounterSolidSyslogMetaSd with getSysUpTime and getLanguage callbacks, includes metaSd alongside originSd in structured-data list, and destroys metaSd/counter/atomicOps during shutdown.
Documentation & Feature Tagging
CLAUDE.md, DEVLOG.md, Bdd/features/structured_data.feature
CLAUDE.md documents new SolidSyslogFreeRtosSysUpTime.h header; DEVLOG.md records slice-8 decisions (StdAtomicOps choice, 64-bit intermediate formula, language reuse, feature tagging status) and verification results; structured_data.feature tag changed from @freertoswip to @udp.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • DavidCozens/solid-syslog#308: Both changes wire structured-data into Example/FreeRtos/SingleTask::InteractiveTask using the same pattern of extending CMake sources and configuring SD callbacks.
  • DavidCozens/solid-syslog#268: This PR directly addresses the meta SD wiring requirement called out in the epic, adding the missing sysUpTime adapter and language callback integration.

Possibly related PRs

  • DavidCozens/solid-syslog#301: Both modify the FreeRTOS SingleTask example (CMakeLists and main.c) to wire SolidSyslog components into InteractiveTask, with the prior PR introducing the UDP sender and this PR extending it with meta SD.
  • DavidCozens/solid-syslog#300: Both extend Tests/Support/FreeRtosFakes with new task-related fake APIs—the prior PR added vTaskDelay tracking and this PR adds tick-count mocking via xTaskGetTickCount.
  • DavidCozens/solid-syslog#297: Both modify Example/FreeRtos/SingleTask by adding sources and extending InteractiveTask wiring; this PR builds on the prior PR's FreeRTOS example foundation.

Poem

🐰 A rabbit hops through FreeRTOS time,
With ticks converted to hundredths sublime,
Meta SD threads in atomic care,
Language and uptime—structured data fair!
From queue to syslog, the message takes flight, 🚀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: wiring meta SD element and adding FreeRtosSysUpTime adapter for slice 8 (#310).
Description check ✅ Passed The description covers purpose (closing #310), changes (meta SD wiring, SysUpTime adapter, atomic ops, BDD untagging), test evidence (host tests, cross-build, BDD scenarios, format checks), and affected areas (example code, platform adapter, tests, CMake).
Linked Issues check ✅ Passed All coding requirements from issue #310 are met: SolidSyslogFreeRtosSysUpTime platform adapter with RFC 3418 wrapping [#310], host TDD with xTaskGetTickCount seam [#310], meta SD wiring in main.c with StdAtomicOps [#310], ExampleLanguage integration [#310], CLAUDE.md documentation [#310], and structured_data.feature untagged with 3/3 BDD scenarios passing [#310].
Out of Scope Changes check ✅ Passed All changes are directly scoped to slice 8 objectives: new SysUpTime adapter, example integration, test support, FreeRTOS fake extensions, and documentation updates align with issue #310 requirements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/freertos-meta-sd

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1105 passed, 🙈 3 skipped)
   🚦   build-linux-clang: 100% successful (✔️ 1042 passed, 🙈 3 skipped)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1042 passed, 🙈 3 skipped)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 100% successful (✔️ 46 passed)
   🚦   bdd-windows-otel: 93% successful (❌ 1 failed, ✔️ 43 passed, 🙈 2 skipped)
   🚦   bdd-freertos-qemu: 37% successful (✔️ 17 passed, 🙈 29 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 954 passed, 🙈 1 skipped)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1105 passed, 🙈 3 skipped)
   🚦   build-linux-clang: 100% successful (✔️ 1042 passed, 🙈 3 skipped)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1042 passed, 🙈 3 skipped)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 100% successful (✔️ 46 passed)
   🚦   bdd-windows-otel: 96% successful (✔️ 44 passed, 🙈 2 skipped)
   🚦   bdd-freertos-qemu: 37% successful (✔️ 17 passed, 🙈 29 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 954 passed, 🙈 1 skipped)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@DavidCozens DavidCozens merged commit fabacab into main May 10, 2026
36 of 37 checks passed
@DavidCozens DavidCozens deleted the feat/freertos-meta-sd branch May 10, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S08.03 slice 8: meta SD wiring + FreeRtosSysUpTime adapter for FreeRTOS example

1 participant