Migrate Trace memory ownership to Strata - #2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate Trace from its library-specific heap/task/mutex policy to the shared ZekStack Strata model and prepare the v0.3.0 release.
Memory policy
TraceStackTypeandTraceStorageMemorywithStrata::MemoryPolicy,Strata::Placement, andStrata::Region.realtimeAllocationas an optional override;std::nulloptinheritsmemory.allocation.init()after the requested runtime policy is applied, so callback ownership followsmemory.allocation/realtimeAllocation.Ownership
Strata::Bufferwhile preserving the fixedTraceRecordring-buffer design.Strata::FreeRTOS::RecursiveMutex.Strata::FreeRTOS::Task.end()and make the destructor perform final cleanup.end()calls during shutdown no longer restart or extend the original shutdown deadline; a later call can safely reap the task after a previously reported timeout.Public/output allocations
TraceResult::messagetoconst char *because Trace result messages are static literals.TraceLogstrings withStrata::String.TraceLogList = Strata::Vector<TraceLog>and use it for query results and flush batches.Diagnostics
Replace Trace-specific PSRAM booleans/stack enums with requested placement and observed region diagnostics for general allocation, realtime allocation, task stack, and all three ring buffers.
Validation and docs
v0.2.x migration
TraceStackType::AutoStrata::Placement::PreferExternalTraceStackType::InternalStrata::Placement::InternalTraceStackType::PsramStrata::Placement::RequireExternalTraceStorageMemory::InternalStrata::Placement::InternalTraceStorageMemory::PreferPsramStrata::Placement::PreferExternalTraceStorageMemory::RequirePsramStrata::Placement::RequireExternalconfig.stackTypeconfig.memory.taskStackconfig.storageMemoryconfig.memory.allocationconfig.realtimeStorageMemoryconfig.realtimeAllocationstd::vector<TraceLog>query resultsTraceLogListTraceResult::message(std::string)const char *The v0.3.0 default is intentionally PSRAM-first:
memory.allocationandmemory.taskStackare bothPreferExternal, and realtime allocations inherit the general policy unless explicitly overridden.