microsoft / microsoft/ebpf-for-windows

Add API to obtain number of map entries

Open
#4,772 1 comment 0 reactions 1 assignee Claimed by @nmlud21 View on GitHub
optimization P2 triaged
Dominant language
C
Stars
3.6k
Forks
311
Avg merge
6d 10h
Merged PRs (30d)
21

Description

### Describe the feature you'd like supported

An API to return the number of map entries present inside a map. This would also require internal bookkeeping to keep track of the number of entries.

Current solution/workaround is to iterate through all of the map entries, but for a map that has a very large number of entries, this is time consuming and not efficient, especially when some cases only require us to know the map size (such as investigations for memory usage)

### Proposed solution

- Add internal tracking when a map entry is inserted and removed
- Add API to return the number of map entries actually used
- Optional - consider updating existing tooling to also query this API and return the number of map entries.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.