zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.48k stars 6.41k forks source link

logging: Sync timestamp between cores #23021

Closed koffes closed 2 years ago

koffes commented 4 years ago

The logging system has a useful feature where a timestamp is prepended each log message.

This works well on single core MCU's, but in some situations you want to investigate multi-core applications. E.g. both cores crash, and you need to figure ut what took place first. Suggest adding a config of type CONFIG_LOG_TIMESTAMP_SYNC. This will ensure that e.g. a LOG_DBG which is called on each core at the same point in time gets the same timestamp.

I realise that this is may well be far from trivial, as well as platform specific. @nordic-krch

carlescufi commented 4 years ago

This should probably be generalized to synchronization between cores of several data items, including timestamps.

koffes commented 4 years ago

@nordic-krch: Is this something that is feasible? We often come across issues where figuring out which log message comes first is essential.

nordic-krch commented 3 years ago

@koffes I've prepared PR which adds mechanism for synchronization. It's nrf53 specific. See #38495