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

fix: GetMap() comment #371

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions libbpfgo.go
Expand Up @@ -418,12 +418,9 @@ func (m *Module) GetMap(mapName string) (*BPFMap, error) {
fd := bpfMap.FileDescriptor()
info, err := GetMapInfoByFD(fd)
if err != nil {
// Compatibility Note: Some older kernels lack BTF (BPF Type Format)
// support for specific BPF map types. In such scenarios, libbpf may
// fail (EPERM) when attempting to retrieve information for these maps.
// Reference: https://elixir.bootlin.com/linux/v5.15.75/source/tools/lib/bpf/gen_loader.c#L401
//
// However, we can still get some map info from the BPF map high level API.
// The consumer of this API may not have sufficient privileges to get
// map info via BPF syscall. However, "some" map info still can be
// retrieved from the BPF object itself.
bpfMap.bpfMapLow = &BPFMapLow{
fd: fd,
info: &BPFMapInfo{
Expand Down