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

drgn.helpers.linux: Add helpers to work with wait-queue(s). #357

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

imran-kn
Copy link
Contributor

Helpers to work with kernel's waitqueue subsystem

@imran-kn imran-kn changed the title Waitq work drgn.helpers.linux: Add helpers to work with wait-queue(s). Oct 15, 2023
Copy link
Owner

@osandov osandov left a comment

Choose a reason for hiding this comment

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

Thanks, this looks great! Only minor comments.

drgn/helpers/linux/waitq.py Outdated Show resolved Hide resolved
drgn/helpers/linux/waitq.py Outdated Show resolved Hide resolved
drgn/helpers/linux/waitq.py Outdated Show resolved Hide resolved
drgn/helpers/linux/waitq.py Outdated Show resolved Hide resolved
drgn/helpers/linux/waitq.py Outdated Show resolved Hide resolved
tests/linux_kernel/helpers/test_waitq.py Outdated Show resolved Hide resolved
tests/linux_kernel/kmod/drgn_test.c Outdated Show resolved Hide resolved
tests/linux_kernel/kmod/drgn_test.c Outdated Show resolved Hide resolved
tests/linux_kernel/helpers/test_waitq.py Outdated Show resolved Hide resolved
tests/linux_kernel/kmod/drgn_test.c Outdated Show resolved Hide resolved
@imran-kn
Copy link
Contributor Author

Thanks, this looks great! Only minor comments.

Thanks for reviewing this. I have integrated your suggestions.

@imran-kn imran-kn requested a review from osandov October 23, 2023 03:09
Copy link
Owner

@osandov osandov left a comment

Choose a reason for hiding this comment

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

A couple things I missed last round, and a couple new small things.

drgn/helpers/linux/wait.py Outdated Show resolved Hide resolved
Iterate over all entries in a given wait-queue.

:param waitq: ``wait_queue_head_t *``
:return: Iterator of ``struct wait_queue_entry *`` or ``struct __wait_queue *`` objects.
Copy link
Owner

Choose a reason for hiding this comment

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

Since you're using the typedef names now, we should document it that way, and also specify why it can be different.

Suggested change
:return: Iterator of ``struct wait_queue_entry *`` or ``struct __wait_queue *`` objects.
:return: Iterator of ``wait_queue_entry_t *`` or ``wait_queue_t *`` objects
depending on the kernel version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Although the comment later in the function gives a summary of the change, I have further explained the relation between these 2 typedefs. Please let me know if it looks good or needs any change.

tests/linux_kernel/helpers/test_wait.py Outdated Show resolved Hide resolved
tests/linux_kernel/helpers/test_wait.py Outdated Show resolved Hide resolved
tests/linux_kernel/kmod/drgn_test.c Outdated Show resolved Hide resolved
Copy link
Owner

@osandov osandov left a comment

Choose a reason for hiding this comment

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

I copy-edited the documentation a bit, and with that, it's ready to go. Thanks!

@osandov osandov merged commit 79a1ea2 into osandov:main Nov 6, 2023
9 of 34 checks passed
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.

2 participants