From 061e86d8f5e99aa6f04d11a3807c8cacdbe7908b Mon Sep 17 00:00:00 2001 From: Lorenz Bauer Date: Tue, 23 Jul 2024 16:55:34 +0100 Subject: [PATCH] map: remove misleading error message when creating without BTF Time and time again people misunderstand errors like the following: map create: cannot allocate memory (without BTF k/v) Instead of focusing on the ENOMEM they assume that it has something to do with BTF. In reality it just means that creating a map has failed, and we didn't supply any BTF during creation. Avoid this confusion by removing the "without BTF k/v" part. Signed-off-by: Lorenz Bauer --- map.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/map.go b/map.go index 61c7d0a80..0b62101c3 100644 --- a/map.go +++ b/map.go @@ -513,9 +513,6 @@ func handleMapCreateError(attr sys.MapCreateAttr, spec *MapSpec, err error) erro return fmt.Errorf("map create: %w (ring map size %d not a multiple of page size %d)", err, maxEntries, pageSize) } } - if attr.BtfFd == 0 { - return fmt.Errorf("map create: %w (without BTF k/v)", err) - } return fmt.Errorf("map create: %w", err) }