From aef16eed78a35a3c99ecccb7eb36eb657244ddc2 Mon Sep 17 00:00:00 2001 From: officeyutong Date: Mon, 9 Oct 2023 23:48:49 +0800 Subject: [PATCH] Simply adds a header and source --- runtime/CMakeLists.txt | 1 + runtime/src/bpf_map/perf_event_array.cpp | 0 runtime/src/bpf_map/perf_event_array.hpp | 24 ++++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 runtime/src/bpf_map/perf_event_array.cpp create mode 100644 runtime/src/bpf_map/perf_event_array.hpp diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 65eb4c6d..3af3955f 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -64,6 +64,7 @@ set(sources src/bpf_map/array_map.cpp src/bpf_map/hash_map.cpp src/bpf_map/ringbuf_map.cpp + src/bpf_map/perf_event_array.cpp ) # list(APPEND sources diff --git a/runtime/src/bpf_map/perf_event_array.cpp b/runtime/src/bpf_map/perf_event_array.cpp new file mode 100644 index 00000000..e69de29b diff --git a/runtime/src/bpf_map/perf_event_array.hpp b/runtime/src/bpf_map/perf_event_array.hpp new file mode 100644 index 00000000..db7c7cc3 --- /dev/null +++ b/runtime/src/bpf_map/perf_event_array.hpp @@ -0,0 +1,24 @@ +#ifndef _PERF_EVENT_ARRAY_HPP +#define _PERF_EVENT_ARRAY_HPP +#include +#include +namespace bpftime +{ +class perf_event_array_impl { + private: + + public: + const static bool should_lock = true; + perf_event_array_impl(boost::interprocess::managed_shared_memory &memory, + uint32_t key_size, uint32_t value_size); + + void *elem_lookup(const void *key); + + long elem_update(const void *key, const void *value, uint64_t flags); + + long elem_delete(const void *key); + + int bpf_map_get_next_key(const void *key, void *next_key); +}; +} // namespace bpftime +#endif