diff --git a/observation/src/numamove/numamove.bpf.c b/observation/src/numamove/numamove.bpf.c new file mode 100644 index 0000000000000000000000000000000000000000..1a52bc6ae856fdd9bec7c0027937ac5fb63a0b67 --- /dev/null +++ b/observation/src/numamove/numamove.bpf.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "vmlinux.h" +#include "maps.bpf.h" +#include +#include + +struct +{ + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 10240); + __type(key, u32); + __type(value, u64); +} start SEC(".maps"); + +__u64 latency = 0; +__u64 num = 0; + +struct +{ + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 1); + __type(key, u32); + __type(value, u64); +} latency_map SEC(".maps"); + +struct +{ + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 1); + __type(key, u32); + __type(value, u64); +} num_map SEC(".maps"); diff --git a/observation/src/numamove/numamove.c b/observation/src/numamove/numamove.c new file mode 100644 index 0000000000000000000000000000000000000000..af29f403fbca15b7880c474d1c17e95ca815b1d6 --- /dev/null +++ b/observation/src/numamove/numamove.c @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +#include "commons.h" +#include "numamove.skel.h" +#include "trace_helpers.h" +#include + +static struct env +{ + bool verbose; +} env = { + .verbose = false, +}; + +static volatile sig_atomic_t exiting; + +const char *argp_program_version = "numamove 0.1"; +const char *argp_program_bug_address = "Jackie Liu "; +const char argp_program_doc[] = + "Show page migrations of type NUMA misplaced per second.\n" + "\n" + "USAGE: numamove [--help]\n" + "\n" + "EXAMPLES:\n" + " numamove # Show page migrations' count and latency"; + +static const struct argp_option opts[] = { + {"verbose", 'v', NULL, 0, "Verbose debug output"}, + {NULL, 'h', NULL, OPTION_HIDDEN, "Show the full help"}, + {}}; \ No newline at end of file diff --git a/prometheus/server/router/router.go b/prometheus/server/router/router.go index 5adbbde016d350847ffffaa294b59a0fc3aa65d2..1067c2bb4cca05b0a474748e36759a8e6d98e26a 100644 --- a/prometheus/server/router/router.go +++ b/prometheus/server/router/router.go @@ -17,6 +17,7 @@ func InitRouter() *gin.Engine { } func RegisterAPIs(router *gin.Engine) { + logger.Debug("router register") global.GlobalClient.RegisterHandlers(router) // prometheus配置文件http方式获取监控target