summaryrefslogtreecommitdiff
path: root/common_modules/module_lib/src/txm_module_object_pointer_get.c
diff options
context:
space:
mode:
authorFrédéric Desbiens <[email protected]>2026-09-16 14:01:07 -0400
committerGitHub <[email protected]>2026-09-16 14:01:07 -0400
commitad558a7b1faa7d32371901e7e2710d2e05f55f8e (patch)
treed676f9000797addc579cb72b6cd05a2cbe3c1255 /common_modules/module_lib/src/txm_module_object_pointer_get.c
parente9b5aec65e7b7221394eeb845a3456c44676ce64 (diff)
Fixed the zero trace time stamps in the Linux ports' MISRA builds (#749)
Both Linux ports define TX_TRACE_TIME_SOURCE as _tx_misra_time_stamp_get() when TX_MISRA_ENABLE is set, and neither implements that function, so both inherit the generic `return(0);` from tx_misra.c. Every trace event is stamped zero. The buffer carries no timing, and the kernel's own check for an entry having been overwritten -- time_stamp against the entry's own stamp, in the block and byte allocates and in the system suspend and resume -- compares zero with zero, so it never fires and a service patches whatever now occupies the slot. Both ports now read in MISRA builds the clock they already read otherwise, _tx_linux_time_stamp.tv_nsec, which TX_TRACE_PORT_EXTENSION refreshes on every recorded event in both forms of the insert. The non-SMP port's non-MISRA macro carried a trailing semicolon, which made it a statement and is why the MISRA insert -- which takes the time source as a function argument -- could not use it; that is dropped and the two branches become one definition. Both headers keep the _tx_misra_time_stamp_get declaration, because tx_misra.c still defines it and is compiled for these ports. The MISRA insert evaluates its time source before the callee refreshes the clock, so each entry carries the reading taken at the previous recorded event. Stamps are real, distinct and ordered, which is what the overwrite check needs. The trace entry update test gains an assertion that the buffer holds an entry the port actually stamped. It fails on dev with ERROR #13 under misra_trace_build and passes with this change. Suites green: 7/7 ThreadX configurations, 5/5 SMP. Assisted-by: Claude Code (Opus 5) <[email protected]>
Diffstat (limited to 'common_modules/module_lib/src/txm_module_object_pointer_get.c')
0 files changed, 0 insertions, 0 deletions