-
Notifications
You must be signed in to change notification settings - Fork 510
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
FEAT: Extend pmreorder with information about state #5419
Comments
This is quite similar to approaches for checking data consistency in concurrent environments, for example: https://github.com/facebook/CacheLib/blob/v2022.04.11.00/cachelib/cachebench/consistency/ValueHistory.h |
You already may pass arbitrary (also runtime generated) string via So it seems that only changes in |
A few additionals feature that would be useful for debugging:
|
to the consistency checker through env variable add to the pmreorder descriptiona mention about env variable it sets Fixes: pmem#5419
FEAT: Extend pmreorder with information about state
Rationale
Currently, the consistency checker under pmreorder is basically stateless. It doesn't have any information about the last successful operation or anything like this.
For example, if we are testing insert operations for a linked list, the only thing which we can reliably test right now is if the list is consistent (there is no crash while iterating, all next/prev pointers match, etc.). We don't have any information about the expected size and so on.
Description
To extend consistency checker with state information we could allow user to pass some extra data from the application through markers. E.g. for a sequence of insert/remove operations for a list:
The values in [] brackets (ideally for all markers before the operation) would be then passed to the consistency checker and the user can interpret them. In the example above the first value in brackets can be interpreted as the size of the list and the second as the element inserted/removed.
If a consistency checker gets a following list of markers:
VALGRIND_EMIT_LOG("INSERT.START[3,10]"); VALGRIND_EMIT_LOG("INSERT.END"); VALGRIND_EMIT_LOG("INSERT.START[4,11]");
it means that the list should contain element 10 and possibly also element 11 (we don't know if inserting of element 11 completed or not).API Changes
Extending markers format?
Implementation details
Allow passing extra parameters through VALGRIND_EMIT_LOG. The parameters could be passed either as strings or using printf-like format maybe?
Each time pmreorder executes consistency-checker it should pass all previous markers (along with user-provided parameters) to the checker. This could be done through env variables or cmd arguments.
POC: https://github.com/igchor/pmdk/tree/pmreorder_pass_markers
The text was updated successfully, but these errors were encountered: