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

Method BatchLookup

map.go:1245–1251  ·  view source on GitHub ↗

BatchLookup looks up many elements in a map at once. "keysOut" and "valuesOut" must be of type slice, a pointer to a slice or buffer will not work. "cursor" is an pointer to an opaque handle. It must be non-nil. Pass "cursor" to subsequent calls of this function to continue the batching operation i

(cursor *MapBatchCursor, keysOut, valuesOut any, opts *BatchOptions)

Source from the content-addressed store, hash-verified

1243// the end of all possible results, even when partial results
1244// are returned. It should be used to evaluate when lookup is "done".
1245func (m *Map) BatchLookup(cursor *MapBatchCursor, keysOut, valuesOut any, opts *BatchOptions) (int, error) {
1246 n, err := m.batchLookup(sys.BPF_MAP_LOOKUP_BATCH, cursor, keysOut, valuesOut, opts)
1247 if err != nil {
1248 return n, fmt.Errorf("map batch lookup: %w", err)
1249 }
1250 return n, nil
1251}
1252
1253// BatchLookupAndDelete looks up many elements in a map at once,
1254//

Callers 7

TestMapBatchFunction · 0.80
TestMapBatchUnprivilegedFunction · 0.80
TestMapBatchCursorReuseFunction · 0.80
TestBatchMapWithLockFunction · 0.80
BenchmarkIterateFunction · 0.80

Calls 1

batchLookupMethod · 0.95

Tested by 7

TestMapBatchFunction · 0.64
TestMapBatchUnprivilegedFunction · 0.64
TestMapBatchCursorReuseFunction · 0.64
TestBatchMapWithLockFunction · 0.64
BenchmarkIterateFunction · 0.64