diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-04-14 18:12:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-04-14 18:12:14 +0000 |
commit | bb50acdcb8073654ea667b8c0272e335bd43f844 (patch) | |
tree | 1e00c8a29871426f8182658928dcb62e42d57ce8 /collectors/ebpf.plugin/ebpf_sync.h | |
parent | Releasing debian version 1.33.1-1. (diff) | |
download | netdata-bb50acdcb8073654ea667b8c0272e335bd43f844.tar.xz netdata-bb50acdcb8073654ea667b8c0272e335bd43f844.zip |
Merging upstream version 1.34.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/ebpf.plugin/ebpf_sync.h')
-rw-r--r-- | collectors/ebpf.plugin/ebpf_sync.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/collectors/ebpf.plugin/ebpf_sync.h b/collectors/ebpf.plugin/ebpf_sync.h index e40c77a3f..2bc18c544 100644 --- a/collectors/ebpf.plugin/ebpf_sync.h +++ b/collectors/ebpf.plugin/ebpf_sync.h @@ -3,6 +3,10 @@ #ifndef NETDATA_EBPF_SYNC_H #define NETDATA_EBPF_SYNC_H 1 +#ifdef LIBBPF_MAJOR_VERSION +#include "includes/sync.skel.h" +#endif + // Module name #define NETDATA_EBPF_MODULE_NAME_SYNC "sync" @@ -13,13 +17,20 @@ #define NETDATA_EBPF_FILE_SEGMENT_CHART "file_segment" #define NETDATA_EBPF_SYNC_SUBMENU "synchronization (eBPF)" +#define NETDATA_SYSCALLS_SYNC "sync" +#define NETDATA_SYSCALLS_SYNCFS "syncfs" +#define NETDATA_SYSCALLS_MSYNC "msync" +#define NETDATA_SYSCALLS_FSYNC "fsync" +#define NETDATA_SYSCALLS_FDATASYNC "fdatasync" +#define NETDATA_SYSCALLS_SYNC_FILE_RANGE "sync_file_range" + #define NETDATA_EBPF_SYNC_SLEEP_MS 800000ULL // configuration file #define NETDATA_SYNC_CONFIG_FILE "sync.conf" #define NETDATA_SYNC_CONFIG_NAME "syscalls" -enum sync_syscalls_index { +typedef enum sync_syscalls_index { NETDATA_SYNC_SYNC_IDX, NETDATA_SYNC_SYNCFS_IDX, NETDATA_SYNC_MSYNC_IDX, @@ -28,15 +39,23 @@ enum sync_syscalls_index { NETDATA_SYNC_SYNC_FILE_RANGE_IDX, NETDATA_SYNC_IDX_END -}; +} sync_syscalls_index_t; typedef struct ebpf_sync_syscalls { char *syscall; int enabled; uint32_t flags; + // BTF structure struct bpf_object *objects; struct bpf_link **probe_links; + + // BPF structure +#ifdef LIBBPF_MAJOR_VERSION + struct sync_bpf *sync_obj; +#else + void *sync_obj; +#endif } ebpf_sync_syscalls_t; enum netdata_sync_charts { @@ -52,5 +71,6 @@ enum netdata_sync_table { extern void *ebpf_sync_thread(void *ptr); extern struct config sync_config; +extern netdata_ebpf_targets_t sync_targets[]; #endif /* NETDATA_EBPF_SYNC_H */ |