MCPcopy
hub / github.com/cilium/ebpf / LookupWithFlags

Method LookupWithFlags

map.go:851–862  ·  view source on GitHub ↗

LookupWithFlags retrieves a value from a Map with flags. Passing LookupLock flag will look up the value of a spin-locked map without returning the lock. This must be specified if the elements contain a spinlock. Calls Close() on valueOut if it is of type **Map or **Program, and *valueOut is not ni

(key, valueOut any, flags MapLookupFlags)

Source from the content-addressed store, hash-verified

849//
850// Returns an error if the key doesn't exist, see ErrKeyNotExist.
851func (m *Map) LookupWithFlags(key, valueOut any, flags MapLookupFlags) error {
852 if m.typ.hasPerCPUValue() {
853 return m.lookupPerCPU(key, valueOut, flags)
854 }
855
856 valueBytes := makeMapSyscallOutput(valueOut, m.fullValueSize)
857 if err := m.lookup(key, valueBytes.Pointer(), flags); err != nil {
858 return err
859 }
860
861 return m.unmarshalValue(valueOut, valueBytes)
862}
863
864// LookupAndDelete retrieves and deletes a value from a Map.
865//

Callers 2

LookupMethod · 0.95
TestMapWithLockFunction · 0.80

Calls 6

lookupPerCPUMethod · 0.95
lookupMethod · 0.95
unmarshalValueMethod · 0.95
makeMapSyscallOutputFunction · 0.85
hasPerCPUValueMethod · 0.80
PointerMethod · 0.80

Tested by 1

TestMapWithLockFunction · 0.64