1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef NETDATA_EBPF_VFS_H
#define NETDATA_EBPF_VFS_H 1
// Module name
#define NETDATA_EBPF_MODULE_NAME_VFS "vfs"
#define NETDATA_DIRECTORY_VFS_CONFIG_FILE "vfs.conf"
#define NETDATA_LATENCY_VFS_SLEEP_MS 750000ULL
// Global chart name
#define NETDATA_VFS_FILE_CLEAN_COUNT "vfs_deleted_objects"
#define NETDATA_VFS_FILE_IO_COUNT "vfs_io"
#define NETDATA_VFS_FILE_ERR_COUNT "vfs_io_error"
#define NETDATA_VFS_IO_FILE_BYTES "vfs_io_bytes"
#define NETDATA_VFS_FSYNC "vfs_fsync"
#define NETDATA_VFS_FSYNC_ERR "vfs_fsync_error"
#define NETDATA_VFS_OPEN "vfs_open"
#define NETDATA_VFS_OPEN_ERR "vfs_open_error"
#define NETDATA_VFS_CREATE "vfs_create"
#define NETDATA_VFS_CREATE_ERR "vfs_create_error"
// Charts created on Apps submenu
#define NETDATA_SYSCALL_APPS_FILE_DELETED "file_deleted"
#define NETDATA_SYSCALL_APPS_VFS_WRITE_CALLS "vfs_write_call"
#define NETDATA_SYSCALL_APPS_VFS_READ_CALLS "vfs_read_call"
#define NETDATA_SYSCALL_APPS_VFS_WRITE_BYTES "vfs_write_bytes"
#define NETDATA_SYSCALL_APPS_VFS_READ_BYTES "vfs_read_bytes"
#define NETDATA_SYSCALL_APPS_VFS_FSYNC "vfs_fsync"
#define NETDATA_SYSCALL_APPS_VFS_OPEN "vfs_open"
#define NETDATA_SYSCALL_APPS_VFS_CREATE "vfs_create"
#define NETDATA_SYSCALL_APPS_VFS_WRITE_CALLS_ERROR "vfs_write_error"
#define NETDATA_SYSCALL_APPS_VFS_READ_CALLS_ERROR "vfs_read_error"
#define NETDATA_SYSCALL_APPS_VFS_FSYNC_CALLS_ERROR "vfs_fsync_error"
#define NETDATA_SYSCALL_APPS_VFS_OPEN_CALLS_ERROR "vfs_open_error"
#define NETDATA_SYSCALL_APPS_VFS_CREATE_CALLS_ERROR "vfs_create_error"
// Group used on Dashboard
#define NETDATA_VFS_GROUP "vfs"
#define NETDATA_VFS_CGROUP_GROUP "vfs (eBPF)"
// Contexts
#define NETDATA_CGROUP_VFS_UNLINK_CONTEXT "cgroup.vfs_unlink"
#define NETDATA_CGROUP_VFS_WRITE_CONTEXT "cgroup.vfs_write"
#define NETDATA_CGROUP_VFS_WRITE_ERROR_CONTEXT "cgroup.vfs_write_error"
#define NETDATA_CGROUP_VFS_READ_CONTEXT "cgroup.vfs_read"
#define NETDATA_CGROUP_VFS_READ_ERROR_CONTEXT "cgroup.vfs_read_error"
#define NETDATA_CGROUP_VFS_WRITE_BYTES_CONTEXT "cgroup.vfs_write_bytes"
#define NETDATA_CGROUP_VFS_READ_BYTES_CONTEXT "cgroup.vfs_read_bytes"
#define NETDATA_CGROUP_VFS_CREATE_CONTEXT "cgroup.vfs_create"
#define NETDATA_CGROUP_VFS_CREATE_ERROR_CONTEXT "cgroup.vfs_create_error"
#define NETDATA_CGROUP_VFS_OPEN_CONTEXT "cgroup.vfs_open"
#define NETDATA_CGROUP_VFS_OPEN_ERROR_CONTEXT "cgroup.vfs_open_error"
#define NETDATA_CGROUP_VFS_FSYNC_CONTEXT "cgroup.vfs_fsync"
#define NETDATA_CGROUP_VFS_FSYNC_ERROR_CONTEXT "cgroup.vfs_fsync_error"
#define NETDATA_SYSTEMD_VFS_UNLINK_CONTEXT "services.vfs_unlink"
#define NETDATA_SYSTEMD_VFS_WRITE_CONTEXT "services.vfs_write"
#define NETDATA_SYSTEMD_VFS_WRITE_ERROR_CONTEXT "services.vfs_write_error"
#define NETDATA_SYSTEMD_VFS_READ_CONTEXT "services.vfs_read"
#define NETDATA_SYSTEMD_VFS_READ_ERROR_CONTEXT "services.vfs_read_error"
#define NETDATA_SYSTEMD_VFS_WRITE_BYTES_CONTEXT "services.vfs_write_bytes"
#define NETDATA_SYSTEMD_VFS_READ_BYTES_CONTEXT "services.vfs_read_bytes"
#define NETDATA_SYSTEMD_VFS_CREATE_CONTEXT "services.vfs_create"
#define NETDATA_SYSTEMD_VFS_CREATE_ERROR_CONTEXT "services.vfs_create_error"
#define NETDATA_SYSTEMD_VFS_OPEN_CONTEXT "services.vfs_open"
#define NETDATA_SYSTEMD_VFS_OPEN_ERROR_CONTEXT "services.vfs_open_error"
#define NETDATA_SYSTEMD_VFS_FSYNC_CONTEXT "services.vfs_fsync"
#define NETDATA_SYSTEMD_VFS_FSYNC_ERROR_CONTEXT "services.vfs_fsync_error"
typedef struct netdata_publish_vfs {
uint64_t pid_tgid;
uint32_t pid;
uint32_t pad;
//Counter
uint32_t write_call;
uint32_t writev_call;
uint32_t read_call;
uint32_t readv_call;
uint32_t unlink_call;
uint32_t fsync_call;
uint32_t open_call;
uint32_t create_call;
//Accumulator
uint64_t write_bytes;
uint64_t writev_bytes;
uint64_t readv_bytes;
uint64_t read_bytes;
//Counter
uint32_t write_err;
uint32_t writev_err;
uint32_t read_err;
uint32_t readv_err;
uint32_t unlink_err;
uint32_t fsync_err;
uint32_t open_err;
uint32_t create_err;
} netdata_publish_vfs_t;
enum netdata_publish_vfs_list {
NETDATA_KEY_PUBLISH_VFS_UNLINK,
NETDATA_KEY_PUBLISH_VFS_READ,
NETDATA_KEY_PUBLISH_VFS_WRITE,
NETDATA_KEY_PUBLISH_VFS_FSYNC,
NETDATA_KEY_PUBLISH_VFS_OPEN,
NETDATA_KEY_PUBLISH_VFS_CREATE,
NETDATA_KEY_PUBLISH_VFS_END
};
enum vfs_counters {
NETDATA_KEY_CALLS_VFS_WRITE,
NETDATA_KEY_ERROR_VFS_WRITE,
NETDATA_KEY_BYTES_VFS_WRITE,
NETDATA_KEY_CALLS_VFS_WRITEV,
NETDATA_KEY_ERROR_VFS_WRITEV,
NETDATA_KEY_BYTES_VFS_WRITEV,
NETDATA_KEY_CALLS_VFS_READ,
NETDATA_KEY_ERROR_VFS_READ,
NETDATA_KEY_BYTES_VFS_READ,
NETDATA_KEY_CALLS_VFS_READV,
NETDATA_KEY_ERROR_VFS_READV,
NETDATA_KEY_BYTES_VFS_READV,
NETDATA_KEY_CALLS_VFS_UNLINK,
NETDATA_KEY_ERROR_VFS_UNLINK,
NETDATA_KEY_CALLS_VFS_FSYNC,
NETDATA_KEY_ERROR_VFS_FSYNC,
NETDATA_KEY_CALLS_VFS_OPEN,
NETDATA_KEY_ERROR_VFS_OPEN,
NETDATA_KEY_CALLS_VFS_CREATE,
NETDATA_KEY_ERROR_VFS_CREATE,
// Keep this as last and don't skip numbers as it is used as element counter
NETDATA_VFS_COUNTER
};
enum netdata_vfs_tables {
NETDATA_VFS_PID,
NETDATA_VFS_ALL,
NETDATA_VFS_CTRL
};
enum netdata_vfs_calls_name {
NETDATA_EBPF_VFS_WRITE,
NETDATA_EBPF_VFS_WRITEV,
NETDATA_EBPF_VFS_READ,
NETDATA_EBPF_VFS_READV,
NETDATA_EBPF_VFS_UNLINK,
NETDATA_EBPF_VFS_FSYNC,
NETDATA_EBPF_VFS_OPEN,
NETDATA_EBPF_VFS_CREATE,
NETDATA_VFS_END_LIST
};
extern netdata_publish_vfs_t **vfs_pid;
void *ebpf_vfs_thread(void *ptr);
void ebpf_vfs_create_apps_charts(struct ebpf_module *em, void *ptr);
extern netdata_ebpf_targets_t vfs_targets[];
extern struct config vfs_config;
#endif /* NETDATA_EBPF_VFS_H */
|