-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 posix-futex
debugging
#904
Conversation
@skuenzer , could you please fix the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the checkpatch and that minor nitpick -- LGTM
Reviewed-by: Cosmin Vancea csvancea@gmail.com
uk_pr_debug("FUTEX_WAIT: Wait %"__PRIsnsec" nsec for wake-up\n", | ||
(__snsec) (*timeout)); | ||
uk_thread_block_until(current, (__snsec) (*timeout)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: maybe turn the expression (__snsec) (*timeout)
into a variable since it is used multiple times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this patch, it is only used a second time in the debug message that I add. However, normally this message is not compiled in, so I find adding a variable that stores the dereferenced value of timeout
for a single occurrence unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skuenzer Looks good to me. One small preference. Either add a space before and after the equal sign or remove them from both sides so that the result will be Condition = 2147483664
instead of Condition =2147483664
.
As far as I can see, these are our standard warnings for long strings. Our |
Right, sorry, I did not notice it. For sure I am fixing this. |
c81af62
to
2a27cdb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now. All checkpatch issues are caused by uk_pr_*
commands which are not ignored at the moment.
Reviewed-by: Florin Postolache florin.postolache.of@gmail.com
Introduces a configuration option to enable debug messages for `lib/posix-futex`. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Adds a set of debug messages to better understand the futex state, like threads getting into blocked state or waking up because of timeouts. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
This commit removes a nesting if-statement to increase readability of `futex_wait()`. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
2a27cdb
to
9873c24
Compare
Beep boop! I ran Unikraft's
Truncated logs starting from first warning 5a3df80:
View complete logs | Learn more about Unikraft's coding style and contribution guidelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved-by: Razvan Deaconescu razvand@unikraft.io
Adds a set of debug messages to better understand the futex state, like threads getting into blocked state or waking up because of timeouts. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #904
This commit removes a nesting if-statement to increase readability of `futex_wait()`. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #904
Base target
Additional configuration
CONFIG_LIBPOSIX_FUTEX=y
CONFIG_LIBPOSIX_FUTEX_DEBUG=y
Description of changes
This PR adds a set of debug messages to better understand the futex state, like threads getting into blocked state or waking up because of timeouts.