Skip to content

feat(perf_buffer): perf_buffer relies on traits rather than specific type#939

Merged
d-e-s-o merged 1 commit intolibbpf:masterfrom
CoderPoet:feat/pinning-map-support
Sep 18, 2024
Merged

feat(perf_buffer): perf_buffer relies on traits rather than specific type#939
d-e-s-o merged 1 commit intolibbpf:masterfrom
CoderPoet:feat/pinning-map-support

Conversation

@CoderPoet
Copy link
Contributor

@CoderPoet CoderPoet commented Sep 9, 2024

Enhancement

This PR introduces a flexible and generic implementation for PerfBufferBuilder to support any type that implements the MapCore and AsFd traits, rather than being restricted to a specific Map type.

Why This Change is Needed:

Currently, PerfBufferBuilder is limited to a specific Map type, which restricts its usability with other types that implement the required traits. This update increases the extensibility of the PerfBufferBuilder and allows developers to use it with a wider variety of map-like structures. For example, a scenario that uses a pinning map.

@CoderPoet CoderPoet force-pushed the feat/pinning-map-support branch 5 times, most recently from 1f975ad to f4c6b42 Compare September 12, 2024 12:25
@CoderPoet CoderPoet force-pushed the feat/pinning-map-support branch from f4c6b42 to 60bb0f0 Compare September 12, 2024 12:32
Copy link
Collaborator

@d-e-s-o d-e-s-o left a comment

Choose a reason for hiding this comment

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

Seems fine to me, thanks!

@d-e-s-o d-e-s-o merged commit 3fc706b into libbpf:master Sep 18, 2024
d-e-s-o added a commit to d-e-s-o/libbpf-rs that referenced this pull request Sep 20, 2024
Add a CHANGELOG entry for pull request libbpf#939, which adjusted the
PerfBufferBuilder type to work with anything implementing the MapCore
trait instead of strictly requiring a Map object.

Signed-off-by: Daniel Müller <deso@posteo.net>
d-e-s-o added a commit that referenced this pull request Sep 20, 2024
Add a CHANGELOG entry for pull request #939, which adjusted the
PerfBufferBuilder type to work with anything implementing the MapCore
trait instead of strictly requiring a Map object.

Signed-off-by: Daniel Müller <deso@posteo.net>
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

Comments