MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / bpf_buffer__new

Function bpf_buffer__new

plugins/wasm_bpf/wasm-bpf.cpp:160–170  ·  view source on GitHub ↗

\brief Create a BPF buffer based on the object map type.

Source from the content-addressed store, hash-verified

158
159/// \brief Create a BPF buffer based on the object map type.
160std::unique_ptr<bpf_buffer> bpf_buffer__new(bpf_map *events) {
161 bpf_map_type map_type = bpf_map__type(events);
162 switch (map_type) {
163 case BPF_MAP_TYPE_PERF_EVENT_ARRAY:
164 return std::make_unique<perf_buffer_wrapper>(events);
165 case BPF_MAP_TYPE_RINGBUF:
166 return std::make_unique<ring_buffer_wrapper>(events);
167 default:
168 return nullptr;
169 }
170}
171
172/// Get the file descriptor of a map by name.
173int32_t wasm_bpf_program::bpf_map_fd_by_name(const char *name) {

Callers 1

bpf_buffer_pollMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected