Modify eBPF.plugin integration (Part I) (#19219)
thiagoftsm committed
Jan 31, 2025 at 09:26 UTC
59864cfe57d742a009043bfee7619c5bd66daf4d
18 files changed
+292
-225
src/collectors/collectors-ipc/collectors-ipc.h
new
+233
@@ -0,0 +1,233 @@
1
+// SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+#ifndef NETDATA_SHARED_DATA_H
4
+#define NETDATA_SHARED_DATA_H 1
5
+
6
+#if defined(OS_LINUX)
7
+
8
+#ifndef TASK_COMM_LEN
9
+#define TASK_COMM_LEN 16
10
+#endif
11
+
12
+// ----------------------------------------------------------------------------
13
+// Enumeration used to identify threads with eBPF PIDs
14
+enum ebpf_pids_index {
15
+ NETDATA_EBPF_PIDS_PROCESS_IDX,
16
+ NETDATA_EBPF_PIDS_SOCKET_IDX,
17
+ NETDATA_EBPF_PIDS_CACHESTAT_IDX,
18
+ NETDATA_EBPF_PIDS_DCSTAT_IDX,
19
+ NETDATA_EBPF_PIDS_SWAP_IDX,
20
+ NETDATA_EBPF_PIDS_VFS_IDX,
21
+ NETDATA_EBPF_PIDS_FD_IDX,
22
+ NETDATA_EBPF_PIDS_SHM_IDX,
23
+
24
+ NETDATA_EBPF_PIDS_PROC_FILE,
25
+ NETDATA_EBPF_PIDS_END_IDX
26
+};
27
+
28
+// ----------------------------------------------------------------------------
29
+// Structures used to read data from kernel ring
30
+typedef struct ebpf_process_stat {
31
+ uint64_t ct;
32
+ uint32_t uid;
33
+ uint32_t gid;
34
+ char name[TASK_COMM_LEN];
35
+
36
+ uint32_t tgid;
37
+ uint32_t pid;
38
+
39
+ //Counter
40
+ uint32_t exit_call;
41
+ uint32_t release_call;
42
+ uint32_t create_process;
43
+ uint32_t create_thread;
44
+
45
+ //Counter
46
+ uint32_t task_err;
47
+} ebpf_process_stat_t;
48
+
49
+typedef struct netdata_socket {
50
+ char name[TASK_COMM_LEN];
51
+
52
+ // Timestamp
53
+ uint64_t first_timestamp;
54
+ uint64_t current_timestamp;
55
+ // Socket additional info
56
+ uint16_t protocol;
57
+ uint16_t family;
58
+ uint32_t external_origin;
59
+ struct {
60
+ uint32_t call_tcp_sent;
61
+ uint32_t call_tcp_received;
62
+ uint64_t tcp_bytes_sent;
63
+ uint64_t tcp_bytes_received;
64
+ uint32_t close; //It is never used with UDP
65
+ uint32_t retransmit; //It is never used with UDP
66
+ uint32_t ipv4_connect;
67
+ uint32_t ipv6_connect;
68
+ uint32_t state; // We do not have charts for it, because we are using network viewer plugin
69
+ } tcp;
70
+
71
+ struct {
72
+ uint32_t call_udp_sent;
73
+ uint32_t call_udp_received;
74
+ uint64_t udp_bytes_sent;
75
+ uint64_t udp_bytes_received;
76
+ } udp;
77
+} netdata_socket_t;
78
+
79
+typedef struct netdata_cachestat_pid {
80
+ uint64_t ct;
81
+ uint32_t tgid;
82
+ uint32_t uid;
83
+ uint32_t gid;
84
+ char name[TASK_COMM_LEN];
85
+
86
+ uint32_t add_to_page_cache_lru;
87
+ uint32_t mark_page_accessed;
88
+ uint32_t account_page_dirtied;
89
+ uint32_t mark_buffer_dirty;
90
+} netdata_cachestat_pid_t;
91
+
92
+typedef struct netdata_dcstat_pid {
93
+ uint64_t ct;
94
+ uint32_t tgid;
95
+ uint32_t uid;
96
+ uint32_t gid;
97
+ char name[TASK_COMM_LEN];
98
+
99
+ uint32_t cache_access;
100
+ uint32_t file_system;
101
+ uint32_t not_found;
102
+} netdata_dcstat_pid_t;
103
+
104
+typedef struct netdata_ebpf_swap {
105
+ uint64_t ct;
106
+ uint32_t tgid;
107
+ uint32_t uid;
108
+ uint32_t gid;
109
+ char name[TASK_COMM_LEN];
110
+
111
+ uint32_t read;
112
+ uint32_t write;
113
+} netdata_ebpf_swap_t;
114
+
115
+typedef struct netdata_ebpf_vfs {
116
+ uint64_t ct;
117
+ uint32_t tgid;
118
+ uint32_t uid;
119
+ uint32_t gid;
120
+ char name[TASK_COMM_LEN];
121
+
122
+ //Counter
123
+ uint32_t write_call;
124
+ uint32_t writev_call;
125
+ uint32_t read_call;
126
+ uint32_t readv_call;
127
+ uint32_t unlink_call;
128
+ uint32_t fsync_call;
129
+ uint32_t open_call;
130
+ uint32_t create_call;
131
+
132
+ //Accumulator
133
+ uint64_t write_bytes;
134
+ uint64_t writev_bytes;
135
+ uint64_t readv_bytes;
136
+ uint64_t read_bytes;
137
+
138
+ //Counter
139
+ uint32_t write_err;
140
+ uint32_t writev_err;
141
+ uint32_t read_err;
142
+ uint32_t readv_err;
143
+ uint32_t unlink_err;
144
+ uint32_t fsync_err;
145
+ uint32_t open_err;
146
+ uint32_t create_err;
147
+} netdata_ebpf_vfs_t;
148
+
149
+typedef struct netdata_fd_stat {
150
+ uint64_t ct;
151
+ uint32_t tgid;
152
+ uint32_t uid;
153
+ uint32_t gid;
154
+ char name[TASK_COMM_LEN];
155
+
156
+ uint32_t open_call; // Open syscalls (open and openat)
157
+ uint32_t close_call; // Close syscall (close)
158
+
159
+ // Errors
160
+ uint32_t open_err;
161
+ uint32_t close_err;
162
+} netdata_fd_stat_t;
163
+
164
+typedef struct netdata_ebpf_shm {
165
+ uint64_t ct;
166
+ uint32_t tgid;
167
+ uint32_t uid;
168
+ uint32_t gid;
169
+ char name[TASK_COMM_LEN];
170
+
171
+ uint32_t get;
172
+ uint32_t at;
173
+ uint32_t dt;
174
+ uint32_t ctl;
175
+} netdata_ebpf_shm_t;
176
+
177
+typedef struct netdata_ebpf_pid_stats {
178
+ ebpf_process_stat_t process;
179
+ netdata_socket_t socket;
180
+ netdata_cachestat_pid_t cachestat;
181
+ netdata_dcstat_pid_t directory_cache;
182
+ netdata_ebpf_swap_t swap;
183
+ netdata_ebpf_vfs_t vfs;
184
+ netdata_fd_stat_t fd;
185
+ netdata_ebpf_shm_t shm;
186
+} netdata_ebpf_pid_stats_t;
187
+
188
+// ----------------------------------------------------------------------------
189
+// Helpers used during integration
190
+
191
+#include <stdlib.h>
192
+
193
+enum netdata_integration_selector {
194
+ NETDATA_INTEGRATION_APPS_EBPF,
195
+ NETDATA_INTEGRATION_CGROUPS_EBPF,
196
+ NETDATA_INTEGRATION_NETWORK_VIEWER_EBPF,
197
+
198
+ // This must be the last option always
199
+ NETDATA_INTEGRATION_END
200
+};
201
+
202
+static inline const char *netdata_integration_pipename(enum netdata_integration_selector idx) {
203
+ const char *pipes[] = { "NETDATA_APPS_PIPENAME", "NETDATA_CGROUP_PIPENAME", "NETDATA_NV_PIPENAME"} ;
204
+ const char *pipename = getenv(pipes[idx]);
205
+ if (pipename)
206
+ return pipename;
207
+
208
+#ifdef _WIN32
209
+ switch (idx) {
210
+ case NETDATA_INTEGRATION_NETWORK_VIEWER_EBPF:
211
+ return "\\\\?\\pipe\\netdata-nv-cli";
212
+ case NETDATA_INTEGRATION_CGROUPS_EBPF:
213
+ return "\\\\?\\pipe\\netdata-cg-cli";
214
+ case NETDATA_INTEGRATION_APPS_EBPF:
215
+ default:
216
+ return "\\\\?\\pipe\\netdata-apps-cli";
217
+ }
218
+#else
219
+ switch (idx) {
220
+ case NETDATA_INTEGRATION_NETWORK_VIEWER_EBPF:
221
+ return "/tmp/netdata-nv-ipc";
222
+ case NETDATA_INTEGRATION_CGROUPS_EBPF:
223
+ return "/tmp/netdata-cg-ipc";
224
+ default:
225
+ case NETDATA_INTEGRATION_APPS_EBPF:
226
+ return "/tmp/netdata-apps-ipc";
227
+ }
228
+#endif
229
+}
230
+
231
+#endif
232
+
233
+#endif //NETDATA_SHARED_DATA_H
src/collectors/ebpf.plugin/ebpf_apps.c
+7
-7
@@ -365,7 +365,7 @@ struct ebpf_target
365
366
size_t apps_groups_targets_count = 0; // # of apps_groups.conf targets
367
368
-int pids_fd[EBPF_PIDS_END_IDX];
368
+int pids_fd[NETDATA_EBPF_PIDS_END_IDX];
369
370
// ----------------------------------------------------------------------------
371
// internal counters
@@ -587,7 +587,7 @@ static inline int ebpf_collect_data_for_pid(pid_t pid)
587
return 0;
588
}
589
590
- ebpf_pid_data_t *p = ebpf_get_pid_data((uint32_t)pid, 0, NULL, EBPF_PIDS_PROC_FILE);
590
+ ebpf_pid_data_t *p = ebpf_get_pid_data((uint32_t)pid, 0, NULL, NETDATA_EBPF_PIDS_PROC_FILE);
591
read_proc_pid_stat(p);
592
593
// check its parent pid
@@ -800,7 +800,7 @@ void ebpf_del_pid_entry(pid_t pid)
800
if (p->prev)
801
p->prev->next = p->next;
802
803
- if ((p->thread_collecting & EBPF_PIDS_PROC_FILE) || p->has_proc_file)
803
+ if ((p->thread_collecting & NETDATA_EBPF_PIDS_PROC_FILE) || p->has_proc_file)
804
ebpf_all_pids_count--;
805
806
rw_spinlock_write_lock(&ebpf_judy_pid.index.rw_spinlock);
@@ -940,7 +940,7 @@ void ebpf_process_sum_values_for_pids(ebpf_process_stat_t *process, struct ebpf_
940
memset(process, 0, sizeof(ebpf_process_stat_t));
941
for (; root; root = root->next) {
942
int32_t pid = root->pid;
943
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_PROCESS_IDX);
943
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_PROCESS_IDX);
944
ebpf_publish_process_t *in = local_pid->process;
945
if (!in)
946
continue;
@@ -967,7 +967,7 @@ void collect_data_for_all_processes(int tbl_pid_stats_fd, int maps_per_core)
967
if (tbl_pid_stats_fd == -1)
968
return;
969
970
- pids_fd[EBPF_PIDS_PROCESS_IDX] = tbl_pid_stats_fd;
970
+ pids_fd[NETDATA_EBPF_PIDS_PROCESS_IDX] = tbl_pid_stats_fd;
971
size_t length = sizeof(ebpf_process_stat_t);
972
if (maps_per_core)
973
length *= ebpf_nprocs;
@@ -982,7 +982,7 @@ void collect_data_for_all_processes(int tbl_pid_stats_fd, int maps_per_core)
982
983
ebpf_process_apps_accumulator(process_stat_vector, maps_per_core);
984
985
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, 0, NULL, EBPF_PIDS_PROCESS_IDX);
985
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, 0, NULL, NETDATA_EBPF_PIDS_PROCESS_IDX);
986
ebpf_publish_process_t *w = local_pid->process;
987
if (!w)
988
local_pid->process = w = ebpf_process_allocate_publish();
@@ -999,7 +999,7 @@ void collect_data_for_all_processes(int tbl_pid_stats_fd, int maps_per_core)
999
if (kill(key, 0)) { // No PID found
1000
ebpf_reset_specific_pid_data(local_pid);
1001
} else { // There is PID, but there is not data anymore
1002
- ebpf_release_pid_data(local_pid, tbl_pid_stats_fd, key, EBPF_PIDS_PROCESS_IDX);
1002
+ ebpf_release_pid_data(local_pid, tbl_pid_stats_fd, key, NETDATA_EBPF_PIDS_PROCESS_IDX);
1003
ebpf_process_release_publish(w);
1004
local_pid->process = NULL;
1005
}
src/collectors/ebpf.plugin/ebpf_apps.h
+13
-48
@@ -3,6 +3,7 @@
3
#ifndef NETDATA_EBPF_APPS_H
4
#define NETDATA_EBPF_APPS_H 1
5
6
+#include "collectors/collectors-ipc/collectors-ipc.h"
7
#include "libnetdata/locks/locks.h"
8
#include "libnetdata/avl/avl.h"
9
#include "libnetdata/clocks/clocks.h"
@@ -17,10 +18,6 @@
18
#define NETDATA_APPS_NET_GROUP "net"
19
#define NETDATA_APPS_IPC_SHM_GROUP "ipc shm"
20
20
-#ifndef TASK_COMM_LEN
21
-#define TASK_COMM_LEN 16
22
-#endif
23
-
21
#include "ebpf_process.h"
22
#include "ebpf_dcstat.h"
23
#include "ebpf_disk.h"
@@ -44,21 +41,7 @@
41
42
#define EBPF_CLEANUP_FACTOR 2
43
47
-enum ebpf_pids_index {
48
- EBPF_PIDS_PROCESS_IDX,
49
- EBPF_PIDS_SOCKET_IDX,
50
- EBPF_PIDS_CACHESTAT_IDX,
51
- EBPF_PIDS_DCSTAT_IDX,
52
- EBPF_PIDS_SWAP_IDX,
53
- EBPF_PIDS_VFS_IDX,
54
- EBPF_PIDS_FD_IDX,
55
- EBPF_PIDS_SHM_IDX,
56
-
57
- EBPF_PIDS_PROC_FILE,
58
- EBPF_PIDS_END_IDX
59
-};
60
-
61
-extern int pids_fd[EBPF_PIDS_END_IDX];
44
+extern int pids_fd[NETDATA_EBPF_PIDS_END_IDX];
45
46
enum ebpf_main_index {
47
EBPF_MODULE_PROCESS_IDX,
@@ -91,24 +74,6 @@ enum ebpf_main_index {
74
75
// ----------------------------------------------------------------------------
76
// Structures used to read information from kernel ring
94
-typedef struct ebpf_process_stat {
95
- uint64_t ct;
96
- uint32_t uid;
97
- uint32_t gid;
98
- char name[TASK_COMM_LEN];
99
-
100
- uint32_t tgid;
101
- uint32_t pid;
102
-
103
- //Counter
104
- uint32_t exit_call;
105
- uint32_t release_call;
106
- uint32_t create_process;
107
- uint32_t create_thread;
108
-
109
- //Counter
110
- uint32_t task_err;
111
-} ebpf_process_stat_t;
77
78
typedef struct __attribute__((packed)) ebpf_publish_process {
79
uint64_t ct;
@@ -310,7 +275,7 @@ static inline ebpf_pid_data_t *ebpf_get_pid_data(uint32_t pid, uint32_t tgid, ch
275
ebpf_pid_data_t *ptr = ebpf_find_or_create_pid_data(pid);
276
ptr->thread_collecting |= 1<<idx;
277
// The caller is getting data to work.
313
- if (!name && idx != EBPF_PIDS_PROC_FILE)
278
+ if (!name && idx != NETDATA_EBPF_PIDS_PROC_FILE)
279
return ptr;
280
281
if (ptr->pid == pid) {
@@ -328,7 +293,7 @@ static inline ebpf_pid_data_t *ebpf_get_pid_data(uint32_t pid, uint32_t tgid, ch
293
294
ptr->next = ebpf_pids_link_list;
295
ebpf_pids_link_list = ptr;
331
- if (idx == EBPF_PIDS_PROC_FILE) {
296
+ if (idx == NETDATA_EBPF_PIDS_PROC_FILE) {
297
ebpf_all_pids_count++;
298
}
299
@@ -350,7 +315,7 @@ static inline void ebpf_reset_specific_pid_data(ebpf_pid_data_t *ptr)
315
{
316
int idx;
317
uint32_t pid = ptr->pid;
353
- for (idx = EBPF_PIDS_PROCESS_IDX; idx < EBPF_PIDS_PROC_FILE; idx++) {
318
+ for (idx = NETDATA_EBPF_PIDS_PROCESS_IDX; idx < NETDATA_EBPF_PIDS_PROC_FILE; idx++) {
319
if (!(ptr->thread_collecting & (1<<idx))) {
320
continue;
321
}
@@ -363,28 +328,28 @@ static inline void ebpf_reset_specific_pid_data(ebpf_pid_data_t *ptr)
328
ebpf_hash_table_pids_count--;
329
void *clean;
330
switch (idx) {
366
- case EBPF_PIDS_PROCESS_IDX:
331
+ case NETDATA_EBPF_PIDS_PROCESS_IDX:
332
clean = ptr->process;
333
break;
369
- case EBPF_PIDS_SOCKET_IDX:
334
+ case NETDATA_EBPF_PIDS_SOCKET_IDX:
335
clean = ptr->socket;
336
break;
372
- case EBPF_PIDS_CACHESTAT_IDX:
337
+ case NETDATA_EBPF_PIDS_CACHESTAT_IDX:
338
clean = ptr->cachestat;
339
break;
375
- case EBPF_PIDS_DCSTAT_IDX:
340
+ case NETDATA_EBPF_PIDS_DCSTAT_IDX:
341
clean = ptr->dc;
342
break;
378
- case EBPF_PIDS_SWAP_IDX:
343
+ case NETDATA_EBPF_PIDS_SWAP_IDX:
344
clean = ptr->swap;
345
break;
381
- case EBPF_PIDS_VFS_IDX:
346
+ case NETDATA_EBPF_PIDS_VFS_IDX:
347
clean = ptr->vfs;
348
break;
384
- case EBPF_PIDS_FD_IDX:
349
+ case NETDATA_EBPF_PIDS_FD_IDX:
350
clean = ptr->fd;
351
break;
387
- case EBPF_PIDS_SHM_IDX:
352
+ case NETDATA_EBPF_PIDS_SHM_IDX:
353
clean = ptr->shm;
354
break;
355
default:
src/collectors/ebpf.plugin/ebpf_cachestat.c
+6
-6
@@ -521,7 +521,7 @@ void ebpf_obsolete_cachestat_apps_charts(struct ebpf_module *em)
521
*/
522
static void ebpf_cachestat_exit(void *pptr)
523
{
524
- pids_fd[EBPF_PIDS_CACHESTAT_IDX] = -1;
524
+ pids_fd[NETDATA_EBPF_PIDS_CACHESTAT_IDX] = -1;
525
ebpf_module_t *em = CLEANUP_FUNCTION_GET_PTR(pptr);
526
if(!em) return;
527
@@ -729,7 +729,7 @@ static void ebpf_read_cachestat_apps_table(int maps_per_core)
729
730
cachestat_apps_accumulator(cv, maps_per_core);
731
732
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, cv->tgid, cv->name, EBPF_PIDS_CACHESTAT_IDX);
732
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, cv->tgid, cv->name, NETDATA_EBPF_PIDS_CACHESTAT_IDX);
733
netdata_publish_cachestat_t *publish = local_pid->cachestat;
734
if (!publish)
735
local_pid->cachestat = publish = ebpf_cachestat_allocate_publish();
@@ -741,7 +741,7 @@ static void ebpf_read_cachestat_apps_table(int maps_per_core)
741
if (kill(key, 0)) { // No PID found
742
ebpf_reset_specific_pid_data(local_pid);
743
} else { // There is PID, but there is not data anymore
744
- ebpf_release_pid_data(local_pid, fd, key, EBPF_PIDS_CACHESTAT_IDX);
744
+ ebpf_release_pid_data(local_pid, fd, key, NETDATA_EBPF_PIDS_CACHESTAT_IDX);
745
ebpf_cachestat_release_publish(publish);
746
local_pid->cachestat = NULL;
747
}
@@ -771,7 +771,7 @@ static void ebpf_update_cachestat_cgroup()
771
int pid = pids->pid;
772
netdata_publish_cachestat_t *out = &pids->cachestat;
773
774
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_CACHESTAT_IDX);
774
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_CACHESTAT_IDX);
775
netdata_publish_cachestat_t *in = local_pid->cachestat;
776
if (!in)
777
continue;
@@ -798,7 +798,7 @@ void ebpf_cachestat_sum_pids(netdata_publish_cachestat_t *publish, struct ebpf_p
798
netdata_cachestat_t *dst = &publish->current;
799
for (; root; root = root->next) {
800
int32_t pid = root->pid;
801
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_CACHESTAT_IDX);
801
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_CACHESTAT_IDX);
802
netdata_publish_cachestat_t *w = local_pid->cachestat;
803
if (!w)
804
continue;
@@ -846,7 +846,7 @@ void *ebpf_read_cachestat_thread(void *ptr)
846
847
uint32_t lifetime = em->lifetime;
848
uint32_t running_time = 0;
849
- pids_fd[EBPF_PIDS_CACHESTAT_IDX] = cachestat_maps[NETDATA_CACHESTAT_PID_STATS].map_fd;
849
+ pids_fd[NETDATA_EBPF_PIDS_CACHESTAT_IDX] = cachestat_maps[NETDATA_CACHESTAT_PID_STATS].map_fd;
850
heartbeat_t hb;
851
heartbeat_init(&hb, update_every * USEC_PER_SEC);
852
while (!ebpf_plugin_stop() && running_time < lifetime) {
src/collectors/ebpf.plugin/ebpf_cachestat.h
-13
@@ -69,19 +69,6 @@ enum cachestat_tables {
69
NETDATA_CACHESTAT_CTRL
70
};
71
72
-typedef struct netdata_cachestat_pid {
73
- uint64_t ct;
74
- uint32_t tgid;
75
- uint32_t uid;
76
- uint32_t gid;
77
- char name[TASK_COMM_LEN];
78
-
79
- uint32_t add_to_page_cache_lru;
80
- uint32_t mark_page_accessed;
81
- uint32_t account_page_dirtied;
82
- uint32_t mark_buffer_dirty;
83
-} netdata_cachestat_pid_t;
84
-
72
typedef struct __attribute__((packed)) netdata_cachestat {
73
uint32_t add_to_page_cache_lru;
74
uint32_t mark_page_accessed;
src/collectors/ebpf.plugin/ebpf_dcstat.c
+6
-6
@@ -449,7 +449,7 @@ static void ebpf_obsolete_dc_global(ebpf_module_t *em)
449
*/
450
static void ebpf_dcstat_exit(void *pptr)
451
{
452
- pids_fd[EBPF_PIDS_DCSTAT_IDX] = -1;
452
+ pids_fd[NETDATA_EBPF_PIDS_DCSTAT_IDX] = -1;
453
ebpf_module_t *em = CLEANUP_FUNCTION_GET_PTR(pptr);
454
if(!em) return;
455
@@ -555,7 +555,7 @@ static void ebpf_read_dc_apps_table(int maps_per_core)
555
556
ebpf_dcstat_apps_accumulator(cv, maps_per_core);
557
558
- ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(key, cv->tgid, cv->name, EBPF_PIDS_DCSTAT_IDX);
558
+ ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(key, cv->tgid, cv->name, NETDATA_EBPF_PIDS_DCSTAT_IDX);
559
netdata_publish_dcstat_t *publish = pid_stat->dc;
560
if (!publish)
561
pid_stat->dc = publish = ebpf_dcallocate_publish();
@@ -571,7 +571,7 @@ static void ebpf_read_dc_apps_table(int maps_per_core)
571
if (kill(key, 0)) { // No PID found
572
ebpf_reset_specific_pid_data(pid_stat);
573
} else { // There is PID, but there is not data anymore
574
- ebpf_release_pid_data(pid_stat, fd, key, EBPF_PIDS_DCSTAT_IDX);
574
+ ebpf_release_pid_data(pid_stat, fd, key, NETDATA_EBPF_PIDS_DCSTAT_IDX);
575
ebpf_dc_release_publish(publish);
576
pid_stat->dc = NULL;
577
}
@@ -597,7 +597,7 @@ void ebpf_dcstat_sum_pids(netdata_publish_dcstat_t *publish, struct ebpf_pid_on_
597
memset(&publish->curr, 0, sizeof(netdata_publish_dcstat_pid_t));
598
for (; root; root = root->next) {
599
int32_t pid = root->pid;
600
- ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_DCSTAT_IDX);
600
+ ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_DCSTAT_IDX);
601
netdata_publish_dcstat_t *w = pid_stat->dc;
602
if (!w)
603
continue;
@@ -651,7 +651,7 @@ void *ebpf_read_dcstat_thread(void *ptr)
651
652
uint32_t lifetime = em->lifetime;
653
uint32_t running_time = 0;
654
- pids_fd[EBPF_PIDS_DCSTAT_IDX] = dcstat_maps[NETDATA_DCSTAT_PID_STATS].map_fd;
654
+ pids_fd[NETDATA_EBPF_PIDS_DCSTAT_IDX] = dcstat_maps[NETDATA_DCSTAT_PID_STATS].map_fd;
655
heartbeat_t hb;
656
heartbeat_init(&hb, update_every * USEC_PER_SEC);
657
while (!ebpf_plugin_stop() && running_time < lifetime) {
@@ -783,7 +783,7 @@ static void ebpf_update_dc_cgroup()
783
for (pids = ect->pids; pids; pids = pids->next) {
784
int pid = pids->pid;
785
netdata_dcstat_pid_t *out = &pids->dc;
786
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_DCSTAT_IDX);
786
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_DCSTAT_IDX);
787
netdata_publish_dcstat_t *in = local_pid->dc;
788
if (!in)
789
continue;
src/collectors/ebpf.plugin/ebpf_dcstat.h
-12
@@ -77,18 +77,6 @@ typedef struct __attribute__((packed)) netdata_publish_dcstat_pid {
77
uint32_t not_found;
78
} netdata_publish_dcstat_pid_t;
79
80
-typedef struct netdata_dcstat_pid {
81
- uint64_t ct;
82
- uint32_t tgid;
83
- uint32_t uid;
84
- uint32_t gid;
85
- char name[TASK_COMM_LEN];
86
-
87
- uint32_t cache_access;
88
- uint32_t file_system;
89
- uint32_t not_found;
90
-} netdata_dcstat_pid_t;
91
-
80
typedef struct __attribute__((packed)) netdata_publish_dcstat {
81
uint64_t ct;
82
src/collectors/ebpf.plugin/ebpf_fd.c
+6
-6
@@ -546,7 +546,7 @@ static void ebpf_obsolete_fd_global(ebpf_module_t *em)
546
*/
547
static void ebpf_fd_exit(void *pptr)
548
{
549
- pids_fd[EBPF_PIDS_FD_IDX] = -1;
549
+ pids_fd[NETDATA_EBPF_PIDS_FD_IDX] = -1;
550
ebpf_module_t *em = CLEANUP_FUNCTION_GET_PTR(pptr);
551
if(!em) return;
552
@@ -698,7 +698,7 @@ static void ebpf_read_fd_apps_table(int maps_per_core)
698
699
fd_apps_accumulator(fv, maps_per_core);
700
701
- ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(key, fv->tgid, fv->name, EBPF_PIDS_FD_IDX);
701
+ ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(key, fv->tgid, fv->name, NETDATA_EBPF_PIDS_FD_IDX);
702
netdata_publish_fd_stat_t *publish_fd = pid_stat->fd;
703
if (!publish_fd)
704
pid_stat->fd = publish_fd = ebpf_fd_allocate_publish();
@@ -715,7 +715,7 @@ static void ebpf_read_fd_apps_table(int maps_per_core)
715
if (kill(key, 0)) { // No PID found
716
ebpf_reset_specific_pid_data(pid_stat);
717
} else { // There is PID, but there is not data anymore
718
- ebpf_release_pid_data(pid_stat, fd, key, EBPF_PIDS_FD_IDX);
718
+ ebpf_release_pid_data(pid_stat, fd, key, NETDATA_EBPF_PIDS_FD_IDX);
719
ebpf_fd_release_publish(publish_fd);
720
pid_stat->fd = NULL;
721
}
@@ -742,7 +742,7 @@ static void ebpf_fd_sum_pids(netdata_fd_stat_t *fd, struct ebpf_pid_on_target *r
742
743
for (; root; root = root->next) {
744
int32_t pid = root->pid;
745
- ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_FD_IDX);
745
+ ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_FD_IDX);
746
netdata_publish_fd_stat_t *w = pid_stat->fd;
747
if (!w)
748
continue;
@@ -792,7 +792,7 @@ void *ebpf_read_fd_thread(void *ptr)
792
793
uint32_t lifetime = em->lifetime;
794
uint32_t running_time = 0;
795
- pids_fd[EBPF_PIDS_FD_IDX] = fd_maps[NETDATA_FD_PID_STATS].map_fd;
795
+ pids_fd[NETDATA_EBPF_PIDS_FD_IDX] = fd_maps[NETDATA_FD_PID_STATS].map_fd;
796
797
heartbeat_t hb;
798
heartbeat_init(&hb, USEC_PER_SEC);
@@ -838,7 +838,7 @@ static void ebpf_update_fd_cgroup()
838
for (pids = ect->pids; pids; pids = pids->next) {
839
int pid = pids->pid;
840
netdata_publish_fd_stat_t *out = &pids->fd;
841
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_FD_IDX);
841
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_FD_IDX);
842
netdata_publish_fd_stat_t *in = local_pid->fd;
843
if (!in)
844
continue;
src/collectors/ebpf.plugin/ebpf_fd.h
-15
@@ -51,21 +51,6 @@ typedef struct __attribute__((packed)) netdata_publish_fd_stat {
51
uint32_t close_err;
52
} netdata_publish_fd_stat_t;
53
54
-typedef struct netdata_fd_stat {
55
- uint64_t ct;
56
- uint32_t tgid;
57
- uint32_t uid;
58
- uint32_t gid;
59
- char name[TASK_COMM_LEN];
60
-
61
- uint32_t open_call; // Open syscalls (open and openat)
62
- uint32_t close_call; // Close syscall (close)
63
-
64
- // Errors
65
- uint32_t open_err;
66
- uint32_t close_err;
67
-} netdata_fd_stat_t;
68
-
54
enum fd_tables {
55
NETDATA_FD_PID_STATS,
56
NETDATA_FD_GLOBAL_STATS,
src/collectors/ebpf.plugin/ebpf_process.c
+2
-2
@@ -226,7 +226,7 @@ static void ebpf_update_process_cgroup()
226
for (pids = ect->pids; pids; pids = pids->next) {
227
int pid = pids->pid;
228
ebpf_publish_process_t *out = &pids->ps;
229
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_PROCESS_IDX);
229
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_PROCESS_IDX);
230
ebpf_publish_process_t *in = local_pid->process;
231
if (!in)
232
continue;
@@ -687,7 +687,7 @@ static void ebpf_process_disable_tracepoints()
687
*/
688
static void ebpf_process_exit(void *pptr)
689
{
690
- pids_fd[EBPF_PIDS_PROCESS_IDX] = -1;
690
+ pids_fd[NETDATA_EBPF_PIDS_PROCESS_IDX] = -1;
691
ebpf_module_t *em = CLEANUP_FUNCTION_GET_PTR(pptr);
692
if(!em) return;
693
src/collectors/ebpf.plugin/ebpf_shm.c
+6
-6
@@ -548,7 +548,7 @@ static void ebpf_update_shm_cgroup()
548
for (pids = ect->pids; pids; pids = pids->next) {
549
int pid = pids->pid;
550
netdata_publish_shm_t *out = &pids->shm;
551
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_SHM_IDX);
551
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_SHM_IDX);
552
netdata_publish_shm_t *in = local_pid->shm;
553
if (!in)
554
continue;
@@ -582,7 +582,7 @@ static void ebpf_read_shm_apps_table(int maps_per_core)
582
583
shm_apps_accumulator(cv, maps_per_core);
584
585
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, cv->tgid, cv->name, EBPF_PIDS_SHM_IDX);
585
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, cv->tgid, cv->name, NETDATA_EBPF_PIDS_SHM_IDX);
586
netdata_publish_shm_t *publish = local_pid->shm;
587
if (!publish)
588
local_pid->shm = publish = ebpf_shm_allocate_publish();
@@ -594,7 +594,7 @@ static void ebpf_read_shm_apps_table(int maps_per_core)
594
if (kill(key, 0)) { // No PID found
595
ebpf_reset_specific_pid_data(local_pid);
596
} else { // There is PID, but there is not data anymore
597
- ebpf_release_pid_data(local_pid, fd, key, EBPF_PIDS_SHM_IDX);
597
+ ebpf_release_pid_data(local_pid, fd, key, NETDATA_EBPF_PIDS_SHM_IDX);
598
ebpf_shm_release_publish(publish);
599
local_pid->shm = NULL;
600
}
@@ -667,7 +667,7 @@ static void ebpf_shm_sum_pids(netdata_publish_shm_t *shm, struct ebpf_pid_on_tar
667
memset(shm, 0, sizeof(netdata_publish_shm_t));
668
for (; root; root = root->next) {
669
int32_t pid = root->pid;
670
- ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_SHM_IDX);
670
+ ebpf_pid_data_t *pid_stat = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_SHM_IDX);
671
netdata_publish_shm_t *w = pid_stat->shm;
672
if (!w)
673
continue;
@@ -1070,7 +1070,7 @@ void *ebpf_read_shm_thread(void *ptr)
1070
1071
uint32_t lifetime = em->lifetime;
1072
uint32_t running_time = 0;
1073
- pids_fd[EBPF_PIDS_SHM_IDX] = shm_maps[NETDATA_PID_SHM_TABLE].map_fd;
1073
+ pids_fd[NETDATA_EBPF_PIDS_SHM_IDX] = shm_maps[NETDATA_PID_SHM_TABLE].map_fd;
1074
heartbeat_t hb;
1075
heartbeat_init(&hb, update_every * USEC_PER_SEC);
1076
while (!ebpf_plugin_stop() && running_time < lifetime) {
@@ -1332,7 +1332,7 @@ static int ebpf_shm_load_bpf(ebpf_module_t *em)
1332
*/
1333
void *ebpf_shm_thread(void *ptr)
1334
{
1335
- pids_fd[EBPF_PIDS_SHM_IDX] = -1;
1335
+ pids_fd[NETDATA_EBPF_PIDS_SHM_IDX] = -1;
1336
ebpf_module_t *em = (ebpf_module_t *)ptr;
1337
1338
CLEANUP_FUNCTION_REGISTER(ebpf_shm_exit) cleanup_ptr = em;
src/collectors/ebpf.plugin/ebpf_shm.h
-13
@@ -37,19 +37,6 @@ typedef struct __attribute__((packed)) netdata_publish_shm {
37
uint32_t ctl;
38
} netdata_publish_shm_t;
39
40
-typedef struct netdata_ebpf_shm {
41
- uint64_t ct;
42
- uint32_t tgid;
43
- uint32_t uid;
44
- uint32_t gid;
45
- char name[TASK_COMM_LEN];
46
-
47
- uint32_t get;
48
- uint32_t at;
49
- uint32_t dt;
50
- uint32_t ctl;
51
-} netdata_ebpf_shm_t;
52
-
40
enum shm_tables {
41
NETDATA_PID_SHM_TABLE,
42
NETDATA_SHM_CONTROLLER,
src/collectors/ebpf.plugin/ebpf_socket.c
+1
-1
@@ -2842,7 +2842,7 @@ static int ebpf_socket_load_bpf(ebpf_module_t *em)
2842
*/
2843
void *ebpf_socket_thread(void *ptr)
2844
{
2845
- pids_fd[EBPF_PIDS_SOCKET_IDX] = -1;
2845
+ pids_fd[NETDATA_EBPF_PIDS_SOCKET_IDX] = -1;
2846
ebpf_module_t *em = (ebpf_module_t *)ptr;
2847
2848
CLEANUP_FUNCTION_REGISTER(ebpf_socket_exit) cleanup_ptr = em;
src/collectors/ebpf.plugin/ebpf_socket.h
-33
@@ -265,39 +265,6 @@ typedef struct ebpf_network_viewer_options {
265
266
extern ebpf_network_viewer_options_t network_viewer_opt;
267
268
-/**
269
- * Structure to store socket information
270
- */
271
-typedef struct netdata_socket {
272
- char name[TASK_COMM_LEN];
273
-
274
- // Timestamp
275
- uint64_t first_timestamp;
276
- uint64_t current_timestamp;
277
- // Socket additional info
278
- uint16_t protocol;
279
- uint16_t family;
280
- uint32_t external_origin;
281
- struct {
282
- uint32_t call_tcp_sent;
283
- uint32_t call_tcp_received;
284
- uint64_t tcp_bytes_sent;
285
- uint64_t tcp_bytes_received;
286
- uint32_t close; //It is never used with UDP
287
- uint32_t retransmit; //It is never used with UDP
288
- uint32_t ipv4_connect;
289
- uint32_t ipv6_connect;
290
- uint32_t state; // We do not have charts for it, because we are using network viewer plugin
291
- } tcp;
292
-
293
- struct {
294
- uint32_t call_udp_sent;
295
- uint32_t call_udp_received;
296
- uint64_t udp_bytes_sent;
297
- uint64_t udp_bytes_received;
298
- } udp;
299
-} netdata_socket_t;
300
-
268
typedef enum netdata_socket_flags {
269
NETDATA_SOCKET_FLAGS_ALREADY_OPEN = (1<<0)
270
} netdata_socket_flags_t;
src/collectors/ebpf.plugin/ebpf_swap.c
+6
-6
@@ -387,7 +387,7 @@ static void ebpf_obsolete_swap_global(ebpf_module_t *em)
387
*/
388
static void ebpf_swap_exit(void *ptr)
389
{
390
- pids_fd[EBPF_PIDS_SWAP_IDX] = -1;
390
+ pids_fd[NETDATA_EBPF_PIDS_SWAP_IDX] = -1;
391
ebpf_module_t *em = (ebpf_module_t *)ptr;
392
393
pthread_mutex_lock(&lock);
@@ -480,7 +480,7 @@ static void ebpf_update_swap_cgroup()
480
for (pids = ect->pids; pids; pids = pids->next) {
481
int pid = pids->pid;
482
netdata_publish_swap_t *out = &pids->swap;
483
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_SWAP_IDX);
483
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_SWAP_IDX);
484
netdata_publish_swap_t *in = local_pid->swap;
485
if (!in)
486
continue;
@@ -505,7 +505,7 @@ static void ebpf_swap_sum_pids(netdata_publish_swap_t *swap, struct ebpf_pid_on_
505
506
for (; root; root = root->next) {
507
int32_t pid = root->pid;
508
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_SWAP_IDX);
508
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_SWAP_IDX);
509
netdata_publish_swap_t *w = local_pid->swap;
510
if (!w)
511
continue;
@@ -556,7 +556,7 @@ static void ebpf_read_swap_apps_table(int maps_per_core)
556
557
swap_apps_accumulator(cv, maps_per_core);
558
559
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, cv->tgid, cv->name, EBPF_PIDS_SWAP_IDX);
559
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, cv->tgid, cv->name, NETDATA_EBPF_PIDS_SWAP_IDX);
560
netdata_publish_swap_t *publish = local_pid->swap;
561
if (!publish)
562
local_pid->swap = publish = ebpf_swap_allocate_publish_swap();
@@ -568,7 +568,7 @@ static void ebpf_read_swap_apps_table(int maps_per_core)
568
if (kill(key, 0)) { // No PID found
569
ebpf_reset_specific_pid_data(local_pid);
570
} else { // There is PID, but there is not data anymore
571
- ebpf_release_pid_data(local_pid, fd, key, EBPF_PIDS_SWAP_IDX);
571
+ ebpf_release_pid_data(local_pid, fd, key, NETDATA_EBPF_PIDS_SWAP_IDX);
572
ebpf_swap_release_publish(publish);
573
local_pid->swap = NULL;
574
}
@@ -604,7 +604,7 @@ void *ebpf_read_swap_thread(void *ptr)
604
605
uint32_t lifetime = em->lifetime;
606
uint32_t running_time = 0;
607
- pids_fd[EBPF_PIDS_SWAP_IDX] = swap_maps[NETDATA_PID_SWAP_TABLE].map_fd;
607
+ pids_fd[NETDATA_EBPF_PIDS_SWAP_IDX] = swap_maps[NETDATA_PID_SWAP_TABLE].map_fd;
608
609
heartbeat_t hb;
610
heartbeat_init(&hb, update_every * USEC_PER_SEC);
src/collectors/ebpf.plugin/ebpf_swap.h
-11
@@ -31,17 +31,6 @@ typedef struct __attribute__((packed)) netdata_publish_swap {
31
uint32_t write;
32
} netdata_publish_swap_t;
33
34
-typedef struct netdata_ebpf_swap {
35
- uint64_t ct;
36
- uint32_t tgid;
37
- uint32_t uid;
38
- uint32_t gid;
39
- char name[TASK_COMM_LEN];
40
-
41
- uint32_t read;
42
- uint32_t write;
43
-} netdata_ebpf_swap_t;
44
-
34
enum swap_tables {
35
NETDATA_PID_SWAP_TABLE,
36
NETDATA_SWAP_CONTROLLER,
src/collectors/ebpf.plugin/ebpf_vfs.c
+6
-6
@@ -1110,7 +1110,7 @@ static void ebpf_vfs_sum_pids(netdata_publish_vfs_t *vfs, struct ebpf_pid_on_tar
1110
1111
for (; root; root = root->next) {
1112
int32_t pid = root->pid;
1113
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_VFS_IDX);
1113
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_VFS_IDX);
1114
netdata_publish_vfs_t *w = local_pid->vfs;
1115
if (!w)
1116
continue;
@@ -1257,7 +1257,7 @@ static void ebpf_vfs_read_apps(int maps_per_core, uint32_t max_period)
1257
1258
vfs_apps_accumulator(vv, maps_per_core);
1259
1260
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, vv->tgid, vv->name, EBPF_PIDS_VFS_IDX);
1260
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(key, vv->tgid, vv->name, NETDATA_EBPF_PIDS_VFS_IDX);
1261
netdata_publish_vfs_t *publish = local_pid->vfs;
1262
if (!publish)
1263
local_pid->vfs = publish = ebpf_vfs_allocate_publish();
@@ -1269,7 +1269,7 @@ static void ebpf_vfs_read_apps(int maps_per_core, uint32_t max_period)
1269
if (kill(key, 0)) { // No PID found
1270
ebpf_reset_specific_pid_data(local_pid);
1271
} else { // There is PID, but there is not data anymore
1272
- ebpf_release_pid_data(local_pid, fd, key, EBPF_PIDS_VFS_IDX);
1272
+ ebpf_release_pid_data(local_pid, fd, key, NETDATA_EBPF_PIDS_VFS_IDX);
1273
ebpf_vfs_release_publish(publish);
1274
local_pid->vfs = NULL;
1275
}
@@ -1300,7 +1300,7 @@ static void read_update_vfs_cgroup()
1300
netdata_publish_vfs_t *out = &pids->vfs;
1301
memset(out, 0, sizeof(netdata_publish_vfs_t));
1302
1303
- ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, EBPF_PIDS_VFS_IDX);
1303
+ ebpf_pid_data_t *local_pid = ebpf_get_pid_data(pid, 0, NULL, NETDATA_EBPF_PIDS_VFS_IDX);
1304
netdata_publish_vfs_t *in = local_pid->vfs;
1305
if (!in)
1306
continue;
@@ -2073,7 +2073,7 @@ void *ebpf_read_vfs_thread(void *ptr)
2073
uint32_t lifetime = em->lifetime;
2074
uint32_t running_time = 0;
2075
uint32_t max_period = EBPF_CLEANUP_FACTOR;
2076
- pids_fd[EBPF_PIDS_VFS_IDX] = vfs_maps[NETDATA_VFS_PID].map_fd;
2076
+ pids_fd[NETDATA_EBPF_PIDS_VFS_IDX] = vfs_maps[NETDATA_VFS_PID].map_fd;
2077
heartbeat_t hb;
2078
heartbeat_init(&hb, update_every * USEC_PER_SEC);
2079
while (!ebpf_plugin_stop() && running_time < lifetime) {
@@ -2624,7 +2624,7 @@ static int ebpf_vfs_load_bpf(ebpf_module_t *em)
2624
*/
2625
void *ebpf_vfs_thread(void *ptr)
2626
{
2627
- pids_fd[EBPF_PIDS_VFS_IDX] = -1;
2627
+ pids_fd[NETDATA_EBPF_PIDS_VFS_IDX] = -1;
2628
ebpf_module_t *em = (ebpf_module_t *)ptr;
2629
2630
CLEANUP_FUNCTION_REGISTER(ebpf_vfs_exit) cleanup_ptr = em;
src/collectors/ebpf.plugin/ebpf_vfs.h
-34
@@ -106,40 +106,6 @@ typedef struct __attribute__((packed)) netdata_publish_vfs {
106
107
} netdata_publish_vfs_t;
108
109
-typedef struct netdata_ebpf_vfs {
110
- uint64_t ct;
111
- uint32_t tgid;
112
- uint32_t uid;
113
- uint32_t gid;
114
- char name[TASK_COMM_LEN];
115
-
116
- //Counter
117
- uint32_t write_call;
118
- uint32_t writev_call;
119
- uint32_t read_call;
120
- uint32_t readv_call;
121
- uint32_t unlink_call;
122
- uint32_t fsync_call;
123
- uint32_t open_call;
124
- uint32_t create_call;
125
-
126
- //Accumulator
127
- uint64_t write_bytes;
128
- uint64_t writev_bytes;
129
- uint64_t readv_bytes;
130
- uint64_t read_bytes;
131
-
132
- //Counter
133
- uint32_t write_err;
134
- uint32_t writev_err;
135
- uint32_t read_err;
136
- uint32_t readv_err;
137
- uint32_t unlink_err;
138
- uint32_t fsync_err;
139
- uint32_t open_err;
140
- uint32_t create_err;
141
-} netdata_ebpf_vfs_t;
142
-
109
enum netdata_publish_vfs_list {
110
NETDATA_KEY_PUBLISH_VFS_UNLINK,
111
NETDATA_KEY_PUBLISH_VFS_READ,