incorrect log section is intermittently sent #84
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/artiq-zynq#84
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This bug sometimes causes the test_rtio.CoredeviceTest.test_address_collision test to fail:
The collision message was printed on the UART but is not present in the log pulled by the test. It seems that sometimes the core device does not send the latest log messages, but only some earlier ones.
The issue is more frequent when running the whole ARTIQ test suite, and not this test in isolation.
What is the core device log level? If it is trace, it could be caused by the logger holding the log buffer while flushing the stream.
The default, DEBUG.
It seems that core0 and core1 are both trying to log at the same time.
Currently, the logger would use
try_lock
to try to lock the log buffer, and give up if it is currently used by other tasks/core. This is mainly used to discard log when poll log is in operation as it would hold the buffer for a long time.There are two possible fixes:
lock
directly and modifymgmt
to reduce the time it holds the buffer. In order to reduce the time we hold the buffer, we need to copy the buffer content and drop the mutex guard before sending the log out. We could raise the log level temporarily when we are sending the log to avoid getting trace logs from the networking modules.lock
but separate core0 and core1 buffer, and swap the mutex together with the buffer with an empty one when we poll the log. This could have better performance, but we need more static buffer.