Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve marker functionality and related dumpfile issues #179

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

loostrum
Copy link
Member

  • Avoid segfaults by avoiding writing when a dumpfile no longer exists
  • Wait for markers to finish writing when 1. Stopping a dump, 2. stopping the IO thread.

The default timeout when waiting for markers is 500 ms. Still, sometimes the last marker is not written. Even with a 5s timeout this happens. To be debugged further in firmware: verify the marker is actually being sent. Perhaps the boolean flag in the firmware (should we send a marker?) can be replaced by a counter to avoid missing markers in quick succession.

Use this to wait for any writing of markers to finish. Used when the dumping to file is stopped,
and when the I/O thread is stopped. Sometimes a marker was written after
closing the dump file. Check if the dumpfile is not nullptr both when
writing a marker and when writing power data
break;
}
}
std::cout << "Marker waiting time: " << elapsed.count() << std::endl;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug code to be removed, then put the elapsed object inside the loop as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant