From 51147d803fc3195ec641f29e1358e1dac92f8bad Mon Sep 17 00:00:00 2001 From: Wangjunqi123 Date: Wed, 21 Jun 2023 16:32:22 +0800 Subject: [PATCH] =?UTF-8?q?biotop=20probe:=20define=20the=20structure=20an?= =?UTF-8?q?d=20variable=20to=20save=20the=20=20info=20of=20start=E3=80=81w?= =?UTF-8?q?hobyreq=20and=20counts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- observation/src/biotop/biotop.bpf.c | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 observation/src/biotop/biotop.bpf.c diff --git a/observation/src/biotop/biotop.bpf.c b/observation/src/biotop/biotop.bpf.c new file mode 100644 index 00000000..8d79e3d9 --- /dev/null +++ b/observation/src/biotop/biotop.bpf.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "vmlinux.h" +#include +#include +#include +#include "biotop.h" +#include "maps.bpf.h" +#include "core_fixes.bpf.h" + +#define MAX_ENTRIES 10240 + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct request *); + __type(value, struct start_req_t); +} start SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct request *); + __type(value, struct who_t); +} whobyreq SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct info_t); + __type(value, struct val_t); +} counts SEC(".maps"); + +char LICENSE[] SEC("license") = "GPL"; -- Gitee