summaryrefslogtreecommitdiffstats
path: root/src/collectors/ebpf.plugin/ebpf_swap.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:18 +0000
commit5da14042f70711ea5cf66e034699730335462f66 (patch)
tree0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/collectors/ebpf.plugin/ebpf_swap.h
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz
netdata-5da14042f70711ea5cf66e034699730335462f66.zip
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/collectors/ebpf.plugin/ebpf_swap.h')
-rw-r--r--src/collectors/ebpf.plugin/ebpf_swap.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/collectors/ebpf.plugin/ebpf_swap.h b/src/collectors/ebpf.plugin/ebpf_swap.h
new file mode 100644
index 000000000..38e700ee0
--- /dev/null
+++ b/src/collectors/ebpf.plugin/ebpf_swap.h
@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_EBPF_SWAP_H
+#define NETDATA_EBPF_SWAP_H 1
+
+// Module name & description
+#define NETDATA_EBPF_MODULE_NAME_SWAP "swap"
+#define NETDATA_EBPF_SWAP_MODULE_DESC "Monitor swap space usage. This thread is integrated with apps and cgroup."
+
+#define NETDATA_SWAP_SLEEP_MS 850000ULL
+
+// charts
+#define NETDATA_MEM_SWAP_CHART "swapcalls"
+#define NETDATA_MEM_SWAP_READ_CHART "swap_read_call"
+#define NETDATA_MEM_SWAP_WRITE_CHART "swap_write_call"
+#define NETDATA_SWAP_SUBMENU "swap"
+
+// configuration file
+#define NETDATA_DIRECTORY_SWAP_CONFIG_FILE "swap.conf"
+
+// Contexts
+#define NETDATA_CGROUP_SWAP_READ_CONTEXT "systemd.cgroup.swap_read"
+#define NETDATA_CGROUP_SWAP_WRITE_CONTEXT "systemd.cgroup.swap_write"
+#define NETDATA_SYSTEMD_SWAP_READ_CONTEXT "systemd.services.swap_read"
+#define NETDATA_SYSTEMD_SWAP_WRITE_CONTEXT "systemd.services.swap_write"
+
+typedef struct netdata_publish_swap {
+ uint64_t ct;
+ uint32_t tgid;
+ uint32_t uid;
+ uint32_t gid;
+ char name[TASK_COMM_LEN];
+
+ uint64_t read;
+ uint64_t write;
+} netdata_publish_swap_t;
+
+enum swap_tables {
+ NETDATA_PID_SWAP_TABLE,
+ NETDATA_SWAP_CONTROLLER,
+ NETDATA_SWAP_GLOBAL_TABLE
+};
+
+enum swap_counters {
+ NETDATA_KEY_SWAP_READPAGE_CALL,
+ NETDATA_KEY_SWAP_WRITEPAGE_CALL,
+
+ // Keep this as last and don't skip numbers as it is used as element counter
+ NETDATA_SWAP_END
+};
+
+void *ebpf_swap_thread(void *ptr);
+void ebpf_swap_create_apps_charts(struct ebpf_module *em, void *ptr);
+
+extern struct config swap_config;
+extern netdata_ebpf_targets_t swap_targets[];
+
+#endif