Skip to content

Ignore compatibility check of pinned map during Collection loading #1753

Answered by ti-mo
SirHao asked this question in Q&A
Discussion options

You must be logged in to vote

@SirHao Since you're using ip2, I assume you're pinning the perf event array to bpffs, which ebpf-go complains about since the pinned map has a different MaxEntries than the one in the CollectionSpec.

First, I'd like to suggest loading and attaching everything using ebpf-go instead of ip2, that will make sure the loading behaviour is at least consistent across the board, though I assume you're dealing with a legacy app or non-Go app you want to integrate with.

Flo's other response only offered you a partial solution; I think in this case you always want to use the existing pinned map instead of potentially creating a new one. Try this:

// Open existing pinned map. [ebpf.NewMapFromID] can …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ti-mo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1744 on April 16, 2025 07:19.