Open brandon-exact opened 2 weeks ago
There was a previous effort to add some tracing https://github.com/zephyrproject-rtos/zephyr/pull/52161 to the SMF.
However, that specific proposal was rejected as it did not use Zephyr's existing tracing framework.
@wysman - did you make any progress with converting your SMF specific tracing mechanism to Zephyr's tracing framework?
Is your feature request related to a problem? Please describe.
Add a optional feature to SMF that tracks a history of states and its reason for transition. Add a shell command to dump the history to console in a nice way. It should be implemented in a way so it can be useful in a coredump
Describe the solution you'd like
One idea would be to add a ring buffer of size N to
struct smf_ctx
that has the new state and the reason it transitioned. The ring buffer would be of a type with:const struct smf_state *current
)struct smf_ctx
could use the same enum)