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

aya/maps: pin for (async)perf_event_array #822

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

astoycos
Copy link
Member

Implement pinning for perf_event_array and async_perf_event_array. Additionally make the core MapData.pin method operate on a reference rather than a mutable reference.

TODO from #783

@netlify
Copy link

netlify bot commented Oct 20, 2023

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 263bcb2
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/6565f8ea632e7100088e9072
😎 Deploy Preview https://deploy-preview-822--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mergify mergify bot added the aya This is about aya (userspace) label Oct 20, 2023
@mergify mergify bot added the test A PR that improves test cases or CI label Oct 21, 2023
@mergify
Copy link

mergify bot commented Oct 21, 2023

Hey @alessandrod, this pull request changes the Aya Public API and requires your review.

@mergify mergify bot requested a review from alessandrod October 21, 2023 01:59
@mergify mergify bot added the api/needs-review Makes an API change that needs review label Oct 21, 2023
@mergify
Copy link

mergify bot commented Oct 23, 2023

@astoycos, this pull request is now in conflict and requires a rebase.

Copy link
Member

@tamird tamird left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alessandrod and @astoycos)


aya/src/maps/perf/async_perf_event_array.rs line 116 at r1 (raw file):

    /// When a map is pinned it will remain loaded until the corresponding file
    /// is deleted. All parent directories in the given `path` must already exist.
    pub fn pin<P: AsRef<Path>>(&mut self, path: P) -> Result<(), PinError> {

shouldn't this take &self?


aya/src/maps/perf/perf_event_array.rs line 206 at r1 (raw file):

    /// When a map is pinned it will remain loaded until the corresponding file
    /// is deleted. All parent directories in the given `path` must already exist.
    pub fn pin<P: AsRef<Path>>(&mut self, path: P) -> Result<(), PinError> {

shouldn't this take &self?

Copy link
Member

@tamird tamird left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @alessandrod and @astoycos)


aya/src/maps/perf/perf_event_array.rs line 7 at r1 (raw file):

    borrow::{Borrow, BorrowMut},
    ops::Deref,
    os::fd::{AsFd as _, AsRawFd, BorrowedFd, RawFd},

this as _ is incorrect conflict resolution

@astoycos
Copy link
Member Author

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alessandrod and @astoycos)

aya/src/maps/perf/async_perf_event_array.rs line 116 at r1 (raw file):

    /// When a map is pinned it will remain loaded until the corresponding file
    /// is deleted. All parent directories in the given `path` must already exist.
    pub fn pin<P: AsRef<Path>>(&mut self, path: P) -> Result<(), PinError> {

shouldn't this take &self?

aya/src/maps/perf/perf_event_array.rs line 206 at r1 (raw file):

    /// When a map is pinned it will remain loaded until the corresponding file
    /// is deleted. All parent directories in the given `path` must already exist.
    pub fn pin<P: AsRef<Path>>(&mut self, path: P) -> Result<(), PinError> {

shouldn't this take &self?

Done, good catch thanks!

Copy link
Member

@tamird tamird left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alessandrod)

Copy link

mergify bot commented Nov 18, 2023

@astoycos, this pull request is now in conflict and requires a rebase.

@mergify mergify bot added the needs-rebase label Nov 18, 2023
aya/src/maps/mod.rs Show resolved Hide resolved
aya/src/maps/perf/perf_event_array.rs Outdated Show resolved Hide resolved
Implement pinning for perf_event_array and async_perf_event_array.
Additionally make the core MapData.pin method operate on a reference
rather than a mutable reference.

Signed-off-by: astoycos <[email protected]>
@alessandrod alessandrod merged commit b176967 into aya-rs:main Nov 28, 2023
20 checks passed
Copy link
Member

@tamird tamird left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r3, all commit messages.
Dismissed @alessandrod from 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api/needs-review Makes an API change that needs review aya This is about aya (userspace) test A PR that improves test cases or CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants