Update ebpf socket (#11441)
thiagoftsm committed
Aug 19, 2021 at 21:06 UTC
19d9a7075a3c67828daa602c60bb50efc3fdcadb
9 files changed
+148
-122
collectors/ebpf.plugin/ebpf.h
+1
@@ -105,6 +105,7 @@ typedef struct ebpf_tracepoint {
105
106
// Chart definitions
107
#define NETDATA_EBPF_FAMILY "ebpf"
108
+#define NETDATA_EBPF_IP_FAMILY "ip"
109
#define NETDATA_FILESYSTEM_FAMILY "filesystem"
110
#define NETDATA_EBPF_MOUNT_GLOBAL_FAMILY "mount_points"
111
#define NETDATA_EBPF_CHART_TYPE_LINE "line"
collectors/ebpf.plugin/ebpf_apps.h
+1
-1
@@ -14,7 +14,7 @@
14
#define NETDATA_APPS_FILE_GROUP "file_access"
15
#define NETDATA_APPS_VFS_GROUP "vfs (eBPF)"
16
#define NETDATA_APPS_PROCESS_GROUP "process (eBPF)"
17
-#define NETDATA_APPS_NET_GROUP "net (eBPF)"
17
+#define NETDATA_APPS_NET_GROUP "net"
18
#define NETDATA_APPS_CACHESTAT_GROUP "page cache (eBPF)"
19
#define NETDATA_APPS_DCSTAT_GROUP "directory cache (eBPF)"
20
collectors/ebpf.plugin/ebpf_socket.c
+65
-61
@@ -11,23 +11,43 @@
11
*
12
*****************************************************************/
13
14
-static char *socket_dimension_names[NETDATA_MAX_SOCKET_VECTOR] = { "sent", "received", "close", "sent",
15
- "received", "retransmitted" };
16
-static char *socket_id_names[NETDATA_MAX_SOCKET_VECTOR] = { "tcp_sendmsg", "tcp_cleanup_rbuf", "tcp_close",
17
- "udp_sendmsg", "udp_recvmsg", "tcp_retransmit_skb" };
14
+static char *socket_dimension_names[NETDATA_MAX_SOCKET_VECTOR] = { "received", "sent", "close",
15
+ "received", "sent", "retransmitted" };
16
+static char *socket_id_names[NETDATA_MAX_SOCKET_VECTOR] = { "tcp_cleanup_rbuf", "tcp_sendmsg", "tcp_close",
17
+ "udp_recvmsg", "udp_sendmsg", "tcp_retransmit_skb" };
18
19
static ebpf_local_maps_t socket_maps[] = {{.name = "tbl_bandwidth",
20
.internal_input = NETDATA_COMPILED_CONNECTIONS_ALLOWED,
21
- .user_input = NETDATA_MAXIMUM_CONNECTIONS_ALLOWED},
21
+ .user_input = NETDATA_MAXIMUM_CONNECTIONS_ALLOWED,
22
+ .type = NETDATA_EBPF_MAP_STATIC,
23
+ .map_fd = ND_EBPF_MAP_FD_NOT_INITIALIZED},
24
+ {.name = "tbl_global_sock",
25
+ .internal_input = NETDATA_SOCKET_COUNTER,
26
+ .user_input = 0, .type = NETDATA_EBPF_MAP_STATIC,
27
+ .map_fd = ND_EBPF_MAP_FD_NOT_INITIALIZED},
28
+ {.name = "tbl_lports",
29
+ .internal_input = NETDATA_SOCKET_COUNTER,
30
+ .user_input = 0, .type = NETDATA_EBPF_MAP_STATIC,
31
+ .map_fd = ND_EBPF_MAP_FD_NOT_INITIALIZED},
32
{.name = "tbl_conn_ipv4",
33
.internal_input = NETDATA_COMPILED_CONNECTIONS_ALLOWED,
24
- .user_input = NETDATA_MAXIMUM_CONNECTIONS_ALLOWED},
34
+ .user_input = NETDATA_MAXIMUM_CONNECTIONS_ALLOWED,
35
+ .type = NETDATA_EBPF_MAP_STATIC,
36
+ .map_fd = ND_EBPF_MAP_FD_NOT_INITIALIZED},
37
{.name = "tbl_conn_ipv6",
38
.internal_input = NETDATA_COMPILED_CONNECTIONS_ALLOWED,
27
- .user_input = NETDATA_MAXIMUM_CONNECTIONS_ALLOWED},
28
- {.name = "tbl_nv_udp_conn_stats",
39
+ .user_input = NETDATA_MAXIMUM_CONNECTIONS_ALLOWED,
40
+ .type = NETDATA_EBPF_MAP_STATIC,
41
+ .map_fd = ND_EBPF_MAP_FD_NOT_INITIALIZED},
42
+ {.name = "tbl_nv_udp",
43
.internal_input = NETDATA_COMPILED_UDP_CONNECTIONS_ALLOWED,
30
- .user_input = NETDATA_MAXIMUM_UDP_CONNECTIONS_ALLOWED},
44
+ .user_input = NETDATA_MAXIMUM_UDP_CONNECTIONS_ALLOWED,
45
+ .type = NETDATA_EBPF_MAP_STATIC,
46
+ .map_fd = ND_EBPF_MAP_FD_NOT_INITIALIZED},
47
+ {.name = "socket_ctrl", .internal_input = NETDATA_CONTROLLER_END,
48
+ .user_input = 0,
49
+ .type = NETDATA_EBPF_MAP_CONTROLLER,
50
+ .map_fd = ND_EBPF_MAP_FD_NOT_INITIALIZED},
51
{.name = NULL, .internal_input = 0, .user_input = 0}};
52
53
static netdata_idx_t *socket_hash_values = NULL;
@@ -50,7 +70,6 @@ netdata_socket_t *socket_values;
70
71
ebpf_network_viewer_port_list_t *listen_ports = NULL;
72
53
-static int *map_fd = NULL;
73
static struct bpf_object *objects = NULL;
74
static struct bpf_link **probe_links = NULL;
75
@@ -289,30 +308,24 @@ static void ebpf_socket_send_data(ebpf_module_t *em)
308
309
// We read bytes from function arguments, but bandiwdth is given in bits,
310
// so we need to multiply by 8 to convert for the final value.
292
- write_count_chart(
293
- NETDATA_TCP_FUNCTION_COUNT, NETDATA_EBPF_FAMILY, socket_publish_aggregated, 3);
294
- write_io_chart(
295
- NETDATA_TCP_FUNCTION_BITS, NETDATA_EBPF_FAMILY, socket_id_names[0], common_tcp.write*8/1000,
296
- socket_id_names[1], common_tcp.read*8/1000);
311
+ write_count_chart(NETDATA_TCP_FUNCTION_COUNT, NETDATA_EBPF_IP_FAMILY, socket_publish_aggregated, 3);
312
+ write_io_chart(NETDATA_TCP_FUNCTION_BITS, NETDATA_EBPF_IP_FAMILY, socket_id_names[0],
313
+ common_tcp.read * 8/BITS_IN_A_KILOBIT, socket_id_names[1],
314
+ common_tcp.write * 8/BITS_IN_A_KILOBIT);
315
if (em->mode < MODE_ENTRY) {
298
- write_err_chart(
299
- NETDATA_TCP_FUNCTION_ERROR, NETDATA_EBPF_FAMILY, socket_publish_aggregated, 2);
300
- }
301
- write_count_chart(
302
- NETDATA_TCP_RETRANSMIT, NETDATA_EBPF_FAMILY, &socket_publish_aggregated[NETDATA_IDX_TCP_RETRANSMIT],
303
- 1);
304
-
305
- write_count_chart(
306
- NETDATA_UDP_FUNCTION_COUNT, NETDATA_EBPF_FAMILY, &socket_publish_aggregated[NETDATA_IDX_UDP_RECVBUF],
307
- 2);
308
- write_io_chart(
309
- NETDATA_UDP_FUNCTION_BITS, NETDATA_EBPF_FAMILY,
310
- socket_id_names[3],(long long)common_udp.write*8/100,
311
- socket_id_names[4], (long long)common_udp.read*8/1000);
316
+ write_err_chart(NETDATA_TCP_FUNCTION_ERROR, NETDATA_EBPF_IP_FAMILY, socket_publish_aggregated, 2);
317
+ }
318
+ write_count_chart(NETDATA_TCP_RETRANSMIT, NETDATA_EBPF_IP_FAMILY,
319
+ &socket_publish_aggregated[NETDATA_IDX_TCP_RETRANSMIT],1);
320
+
321
+ write_count_chart(NETDATA_UDP_FUNCTION_COUNT, NETDATA_EBPF_IP_FAMILY,
322
+ &socket_publish_aggregated[NETDATA_IDX_UDP_RECVBUF],2);
323
+ write_io_chart(NETDATA_UDP_FUNCTION_BITS, NETDATA_EBPF_IP_FAMILY,
324
+ socket_id_names[3], (long long)common_udp.read * 8/BITS_IN_A_KILOBIT,
325
+ socket_id_names[4], (long long)common_udp.write * 8/BITS_IN_A_KILOBIT);
326
if (em->mode < MODE_ENTRY) {
313
- write_err_chart(
314
- NETDATA_UDP_FUNCTION_ERROR, NETDATA_EBPF_FAMILY, &socket_publish_aggregated[NETDATA_UDP_START],
315
- 2);
327
+ write_err_chart(NETDATA_UDP_FUNCTION_ERROR, NETDATA_EBPF_IP_FAMILY,
328
+ &socket_publish_aggregated[NETDATA_UDP_START], 2);
329
}
330
}
331
@@ -445,11 +458,11 @@ void ebpf_socket_send_apps_data(ebpf_module_t *em, struct target *root)
458
*/
459
static void ebpf_create_global_charts(ebpf_module_t *em)
460
{
448
- ebpf_create_chart(NETDATA_EBPF_FAMILY,
461
+ ebpf_create_chart(NETDATA_EBPF_IP_FAMILY,
462
NETDATA_TCP_FUNCTION_COUNT,
463
"Calls to internal functions",
464
EBPF_COMMON_DIMENSION_CALL,
452
- NETDATA_SOCKET_GROUP,
465
+ NETDATA_SOCKET_KERNEL_FUNCTIONS,
466
NULL,
467
NETDATA_EBPF_CHART_TYPE_LINE,
468
21070,
@@ -457,22 +470,22 @@ static void ebpf_create_global_charts(ebpf_module_t *em)
470
socket_publish_aggregated,
471
3, NETDATA_EBPF_MODULE_NAME_SOCKET);
472
460
- ebpf_create_chart(NETDATA_EBPF_FAMILY, NETDATA_TCP_FUNCTION_BITS,
473
+ ebpf_create_chart(NETDATA_EBPF_IP_FAMILY, NETDATA_TCP_FUNCTION_BITS,
474
"TCP bandwidth", EBPF_COMMON_DIMENSION_BITS,
462
- NETDATA_SOCKET_GROUP,
475
+ NETDATA_SOCKET_KERNEL_FUNCTIONS,
476
NULL,
477
NETDATA_EBPF_CHART_TYPE_LINE,
478
21071,
479
ebpf_create_global_dimension,
480
socket_publish_aggregated,
468
- 3, NETDATA_EBPF_MODULE_NAME_SOCKET);
481
+ 2, NETDATA_EBPF_MODULE_NAME_SOCKET);
482
483
if (em->mode < MODE_ENTRY) {
471
- ebpf_create_chart(NETDATA_EBPF_FAMILY,
484
+ ebpf_create_chart(NETDATA_EBPF_IP_FAMILY,
485
NETDATA_TCP_FUNCTION_ERROR,
486
"TCP errors",
487
EBPF_COMMON_DIMENSION_CALL,
475
- NETDATA_SOCKET_GROUP,
488
+ NETDATA_SOCKET_KERNEL_FUNCTIONS,
489
NULL,
490
NETDATA_EBPF_CHART_TYPE_LINE,
491
21072,
@@ -481,11 +494,11 @@ static void ebpf_create_global_charts(ebpf_module_t *em)
494
2, NETDATA_EBPF_MODULE_NAME_SOCKET);
495
}
496
484
- ebpf_create_chart(NETDATA_EBPF_FAMILY,
497
+ ebpf_create_chart(NETDATA_EBPF_IP_FAMILY,
498
NETDATA_TCP_RETRANSMIT,
499
"Packages retransmitted",
500
EBPF_COMMON_DIMENSION_CALL,
488
- NETDATA_SOCKET_GROUP,
501
+ NETDATA_SOCKET_KERNEL_FUNCTIONS,
502
NULL,
503
NETDATA_EBPF_CHART_TYPE_LINE,
504
21073,
@@ -493,11 +506,11 @@ static void ebpf_create_global_charts(ebpf_module_t *em)
506
&socket_publish_aggregated[NETDATA_IDX_TCP_RETRANSMIT],
507
1, NETDATA_EBPF_MODULE_NAME_SOCKET);
508
496
- ebpf_create_chart(NETDATA_EBPF_FAMILY,
509
+ ebpf_create_chart(NETDATA_EBPF_IP_FAMILY,
510
NETDATA_UDP_FUNCTION_COUNT,
511
"UDP calls",
512
EBPF_COMMON_DIMENSION_CALL,
500
- NETDATA_SOCKET_GROUP,
513
+ NETDATA_SOCKET_KERNEL_FUNCTIONS,
514
NULL,
515
NETDATA_EBPF_CHART_TYPE_LINE,
516
21074,
@@ -505,9 +518,9 @@ static void ebpf_create_global_charts(ebpf_module_t *em)
518
&socket_publish_aggregated[NETDATA_IDX_UDP_RECVBUF],
519
2, NETDATA_EBPF_MODULE_NAME_SOCKET);
520
508
- ebpf_create_chart(NETDATA_EBPF_FAMILY, NETDATA_UDP_FUNCTION_BITS,
521
+ ebpf_create_chart(NETDATA_EBPF_IP_FAMILY, NETDATA_UDP_FUNCTION_BITS,
522
"UDP bandwidth", EBPF_COMMON_DIMENSION_BITS,
510
- NETDATA_SOCKET_GROUP,
523
+ NETDATA_SOCKET_KERNEL_FUNCTIONS,
524
NULL,
525
NETDATA_EBPF_CHART_TYPE_LINE,
526
21075,
@@ -516,11 +529,11 @@ static void ebpf_create_global_charts(ebpf_module_t *em)
529
2, NETDATA_EBPF_MODULE_NAME_SOCKET);
530
531
if (em->mode < MODE_ENTRY) {
519
- ebpf_create_chart(NETDATA_EBPF_FAMILY,
532
+ ebpf_create_chart(NETDATA_EBPF_IP_FAMILY,
533
NETDATA_UDP_FUNCTION_ERROR,
534
"UDP errors",
535
EBPF_COMMON_DIMENSION_CALL,
523
- NETDATA_SOCKET_GROUP,
536
+ NETDATA_SOCKET_KERNEL_FUNCTIONS,
537
NULL,
538
NETDATA_EBPF_CHART_TYPE_LINE,
539
21076,
@@ -1439,7 +1452,7 @@ static void read_listen_table()
1452
uint16_t key = 0;
1453
uint16_t next_key = 0;
1454
1442
- int fd = map_fd[NETDATA_SOCKET_LISTEN_TABLE];
1455
+ int fd = socket_maps[NETDATA_SOCKET_LPORTS].map_fd;
1456
uint8_t value;
1457
while (bpf_map_get_next_key(fd, &key, &next_key) == 0) {
1458
int test = bpf_map_lookup_elem(fd, &key, &value);
@@ -1478,8 +1491,8 @@ void *ebpf_socket_read_hash(void *ptr)
1491
heartbeat_t hb;
1492
heartbeat_init(&hb);
1493
usec_t step = NETDATA_SOCKET_READ_SLEEP_MS * em->update_time;
1481
- int fd_ipv4 = map_fd[NETDATA_SOCKET_IPV4_HASH_TABLE];
1482
- int fd_ipv6 = map_fd[NETDATA_SOCKET_IPV6_HASH_TABLE];
1494
+ int fd_ipv4 = socket_maps[NETDATA_SOCKET_TABLE_IPV4].map_fd;
1495
+ int fd_ipv6 = socket_maps[NETDATA_SOCKET_TABLE_IPV6].map_fd;
1496
int network_connection = em->optional;
1497
while (!close_ebpf_plugin) {
1498
usec_t dt = heartbeat_next(&hb, step);
@@ -1506,7 +1519,7 @@ static void read_hash_global_tables()
1519
netdata_idx_t res[NETDATA_SOCKET_COUNTER];
1520
1521
netdata_idx_t *val = socket_hash_values;
1509
- int fd = map_fd[NETDATA_SOCKET_GLOBAL_HASH_TABLE];
1522
+ int fd = socket_maps[NETDATA_SOCKET_GLOBAL].map_fd;
1523
for (idx = 0; idx < NETDATA_SOCKET_COUNTER; idx++) {
1524
if (!bpf_map_lookup_elem(fd, &idx, val)) {
1525
uint64_t total = 0;
@@ -1588,7 +1601,7 @@ void ebpf_socket_bandwidth_accumulator(ebpf_bandwidth_t *out)
1601
*/
1602
static void ebpf_socket_update_apps_data()
1603
{
1591
- int fd = map_fd[NETDATA_SOCKET_APPS_HASH_TABLE];
1604
+ int fd = socket_maps[NETDATA_SOCKET_TABLE_BANDWIDTH].map_fd;
1605
ebpf_bandwidth_t *eb = bandwidth_vector;
1606
uint32_t key;
1607
struct pid_stat *pids = root_of_pids;
@@ -1930,14 +1943,6 @@ static void ebpf_socket_allocate_global_vectors(size_t length)
1943
outbound_vectors.plot = callocz(network_viewer_opt.max_dim, sizeof(netdata_socket_plot_t));
1944
}
1945
1933
-/**
1934
- * Set local function pointers, this function will never be compiled with static libraries
1935
- */
1936
-static void set_local_pointers()
1937
-{
1938
- map_fd = socket_data.map_fd;
1939
-}
1940
-
1946
/**
1947
* Initialize Inbound and Outbound
1948
*
@@ -2887,7 +2892,6 @@ void *ebpf_socket_thread(void *ptr)
2892
goto endsocket;
2893
}
2894
2890
- set_local_pointers();
2895
if (running_on_kernel < NETDATA_EBPF_KERNEL_5_0)
2896
em->mode = MODE_ENTRY;
2897
collectors/ebpf.plugin/ebpf_socket.h
+5
-8
@@ -9,13 +9,6 @@
9
10
// Vector indexes
11
#define NETDATA_UDP_START 3
12
-#define NETDATA_RETRANSMIT_START 5
13
-
14
-#define NETDATA_SOCKET_APPS_HASH_TABLE 0
15
-#define NETDATA_SOCKET_IPV4_HASH_TABLE 1
16
-#define NETDATA_SOCKET_IPV6_HASH_TABLE 2
17
-#define NETDATA_SOCKET_GLOBAL_HASH_TABLE 4
18
-#define NETDATA_SOCKET_LISTEN_TABLE 5
12
13
#define NETDATA_SOCKET_READ_SLEEP_MS 800000ULL
14
@@ -35,9 +28,12 @@
28
29
enum ebpf_socket_table_list {
30
NETDATA_SOCKET_TABLE_BANDWIDTH,
31
+ NETDATA_SOCKET_GLOBAL,
32
+ NETDATA_SOCKET_LPORTS,
33
NETDATA_SOCKET_TABLE_IPV4,
34
NETDATA_SOCKET_TABLE_IPV6,
40
- NETDATA_SOCKET_TABLE_UDP
35
+ NETDATA_SOCKET_TABLE_UDP,
36
+ NETDATA_SOCKET_TABLE_CTRL
37
};
38
39
enum ebpf_socket_publish_index {
@@ -78,6 +74,7 @@ typedef enum ebpf_socket_idx {
74
} ebpf_socket_index_t;
75
76
#define NETDATA_SOCKET_GROUP "Socket"
77
+#define NETDATA_SOCKET_KERNEL_FUNCTIONS "kernel"
78
#define NETDATA_NETWORK_CONNECTIONS_GROUP "Network connections"
79
80
// Global chart name
libnetdata/ebpf/ebpf.c
+15
-10
@@ -533,7 +533,7 @@ int ebpf_load_config(struct config *config, char *filename)
533
534
static netdata_run_mode_t ebpf_select_mode(char *mode)
535
{
536
- if (!strcasecmp(mode, "return"))
536
+ if (!strcasecmp(mode,EBPF_CFG_LOAD_MODE_RETURN ))
537
return MODE_RETURN;
538
else if (!strcasecmp(mode, "dev"))
539
return MODE_DEVMODE;
@@ -541,16 +541,23 @@ static netdata_run_mode_t ebpf_select_mode(char *mode)
541
return MODE_ENTRY;
542
}
543
544
+static void ebpf_select_mode_string(char *output, size_t len, netdata_run_mode_t sel)
545
+{
546
+ if (sel == MODE_RETURN)
547
+ strncpyz(output, EBPF_CFG_LOAD_MODE_RETURN, len);
548
+ else
549
+ strncpyz(output, EBPF_CFG_LOAD_MODE_DEFAULT, len);
550
+}
551
+
552
/**
553
* @param modules structure that will be updated
546
- * @param user_cfg is this an user configuration?
554
*/
548
-void ebpf_update_module_using_config(ebpf_module_t *modules, int user_cfg)
555
+void ebpf_update_module_using_config(ebpf_module_t *modules)
556
{
550
- if (user_cfg) {
551
- char *mode = appconfig_get(modules->cfg, EBPF_GLOBAL_SECTION, EBPF_CFG_LOAD_MODE, EBPF_CFG_LOAD_MODE_DEFAULT);
552
- modules->mode = ebpf_select_mode(mode);
553
- }
557
+ char default_value[EBPF_MAX_MODE_LENGTH + 1];
558
+ ebpf_select_mode_string(default_value, EBPF_MAX_MODE_LENGTH, modules->mode);
559
+ char *mode = appconfig_get(modules->cfg, EBPF_GLOBAL_SECTION, EBPF_CFG_LOAD_MODE, default_value);
560
+ modules->mode = ebpf_select_mode(mode);
561
562
modules->update_time = (int)appconfig_get_number(modules->cfg, EBPF_GLOBAL_SECTION,
563
EBPF_CFG_UPDATE_EVERY, modules->update_time);
@@ -577,17 +584,15 @@ void ebpf_update_module(ebpf_module_t *em)
584
{
585
char filename[FILENAME_MAX+1];
586
ebpf_mount_config_name(filename, FILENAME_MAX, ebpf_user_config_dir, em->config_file);
580
- int from_user = 1;
587
if (!ebpf_load_config(em->cfg, filename)) {
588
ebpf_mount_config_name(filename, FILENAME_MAX, ebpf_stock_config_dir, em->config_file);
583
- from_user = 0;
589
if (!ebpf_load_config(em->cfg, filename)) {
590
error("Cannot load the ebpf configuration file %s", em->config_file);
591
return;
592
}
593
}
594
590
- ebpf_update_module_using_config(em, from_user);
595
+ ebpf_update_module_using_config(em);
596
}
597
598
//----------------------------------------------------------------------------------------------------------------------
libnetdata/ebpf/ebpf.h
+1
@@ -15,6 +15,7 @@
15
#define EBPF_CFG_LOAD_MODE "ebpf load mode"
16
#define EBPF_CFG_LOAD_MODE_DEFAULT "entry"
17
#define EBPF_CFG_LOAD_MODE_RETURN "return"
18
+#define EBPF_MAX_MODE_LENGTH 6
19
20
#define EBPF_CFG_UPDATE_EVERY "update every"
21
#define EBPF_CFG_PID_SIZE "pid table size"
packaging/ebpf.checksums
+4
-3
@@ -1,3 +1,4 @@
1
-3a2a6ae05c38d798b3230ba8018f1794530abf41d5826bc9e0f10bf688d63e3f netdata-kernel-collector-glibc-v0.7.7.tar.xz
2
-29331d14a104db423cc5849b67be0796c5320f08bbd1fe5b76000bc0a60eaab1 netdata-kernel-collector-musl-v0.7.7.tar.xz
3
-60b09083653ae1e0f143c3c6ed0420bbcf7278f1997795bf8f72cc7e154db344 netdata-kernel-collector-static-v0.7.7.tar.xz
1
+a56eece7b09b795a3a75e317baff0bc46b3207a0a5535c179dc4bce6a144de36 netdata-kernel-collector-glibc-v0.7.8.1.tar.xz
2
+5e98ed15ab8ba667065f17f9722f4cf86f2932e454015c2a5c169ccb950bbb33 netdata-kernel-collector-musl-v0.7.8.1.tar.xz
3
+d93dff80d0b0e41478f734f44edfdb1bf1cfbd57db4c9f4fc34d703f436a77a6 netdata-kernel-collector-static-v0.7.8.1.tar.xz
4
+
packaging/ebpf.version
+2
-1
@@ -1 +1,2 @@
1
-v0.7.7
1
+v0.7.8.1
2
+
web/gui/dashboard_info.js
+54
-38
@@ -61,7 +61,7 @@ netdataDashboard.menu = {
61
icon: '<i class="fas fa-cloud"></i>',
62
info: function (os) {
63
if (os === "linux")
64
- return 'Metrics for the networking stack of the system. These metrics are collected from <code>/proc/net/netstat</code>, apply to both IPv4 and IPv6 traffic and are related to operation of the kernel networking stack.';
64
+ return 'Metrics for the networking stack of the system. These metrics are collected from <code>/proc/net/netstat</code> or attaching <code>kprobes</code> to kernel functions, apply to both IPv4 and IPv6 traffic and are related to operation of the kernel networking stack.';
65
else
66
return 'Metrics for the networking stack of the system.';
67
}
@@ -835,6 +835,16 @@ netdataDashboard.submenu = {
835
'apps.file_access': {
836
title: 'File Access',
837
info: 'Netdata also gives a summary for this chart on <a href="#menu_filesystem_submenu_File_access">Filesystem submenu</a> (more details on <a href="https://learn.netdata.cloud/docs/agent/collectors/ebpf.plugin#file" target="_blank">eBPF plugin file chart section</a>).'
838
+ },
839
+
840
+ 'ip.kernel': {
841
+ title: 'Kernel Functions',
842
+ info: 'Next charts are made when <code>ebpf.plugin</code> is running on your host. When integration with apps is <a href="https://learn.netdata.cloud/guides/troubleshoot/monitor-debug-applications-ebpf" target="_blank">enabled</a>, Netdata also shows calls for kernel functions per <a href="#menu_apps_submenu_net">application</a>.'
843
+ },
844
+
845
+ 'apps.net': {
846
+ title: 'Network monitoring',
847
+ info: 'Netdata also gives a summary for eBPF charts in <a href="#menu_ip_submenu_kernel">Networking Stack submenu</a>.'
848
}
849
};
850
@@ -1185,6 +1195,42 @@ netdataDashboard.context = {
1195
info: 'TCP connection aborts. <b>baddata</b> (<code>TCPAbortOnData</code>) happens while the connection is on <code>FIN_WAIT1</code> and the kernel receives a packet with a sequence number beyond the last one for this connection - the kernel responds with <code>RST</code> (closes the connection). <b>userclosed</b> (<code>TCPAbortOnClose</code>) happens when the kernel receives data on an already closed connection and responds with <code>RST</code>. <b>nomemory</b> (<code>TCPAbortOnMemory</code> happens when there are too many orphaned sockets (not attached to an fd) and the kernel has to drop a connection - sometimes it will send an <code>RST</code>, sometimes it won\'t. <b>timeout</b> (<code>TCPAbortOnTimeout</code>) happens when a connection times out. <b>linger</b> (<code>TCPAbortOnLinger</code>) happens when the kernel killed a socket that was already closed by the application and lingered around for long enough. <b>failed</b> (<code>TCPAbortFailed</code>) happens when the kernel attempted to send an <code>RST</code> but failed because there was no memory available.'
1196
},
1197
1198
+ 'ip.tcp_functions': {
1199
+ title : 'TCP calls',
1200
+ info: 'Successful or failed calls to functions <code>tcp_sendmsg</code>, <code>tcp_cleanup_rbuf</code>, and <code>tcp_close</code>.'
1201
+ },
1202
+
1203
+ 'ip.total_tcp_bandwidth': {
1204
+ title : 'TCP bandwidth',
1205
+ info: 'Bytes sent and received by functions <code>tcp_sendmsg</code> and <code>tcp_cleanup_rbuf</code>. We use <code>tcp_cleanup_rbuf</code> instead of <code>tcp_recvmsg</code>, because the last one misses <code>tcp_read_sock()</code> traffic and we would also need to have more probes to get the socket and package size.'
1206
+ },
1207
+
1208
+ 'ip.tcp_error': {
1209
+ title : 'TCP errors',
1210
+ info: 'Failed calls to functions <code>tcp_sendmsg</code>, <code>tcp_cleanup_rbuf</code>, and <code>tcp_close</code>.'
1211
+ },
1212
+
1213
+ 'ip.tcp_retransmit': {
1214
+ title : 'TCP retransmit',
1215
+ info: 'Number of packets retransmitted by function <code>tcp_retransmit_skb</code>.'
1216
+ },
1217
+
1218
+ 'ip.udp_functions': {
1219
+ title : 'UDP calls',
1220
+ info: 'Successful or failed calls to functions <code>udp_sendmsg</code> and <code>udp_recvmsg</code>.'
1221
+ },
1222
+
1223
+ 'ip.total_udp_bandwidth': {
1224
+ title : 'UDP bandwidth',
1225
+ info: 'Bytes sent and received by functions <code>udp_sendmsg</code> and <code>udp_recvmsg</code>.'
1226
+ },
1227
+
1228
+ 'ip.udp_error': {
1229
+ title : 'UDP errors',
1230
+ info: 'Failed calls to functions <code>udp_sendmsg</code> and <code>udp_recvmsg</code>.'
1231
+ },
1232
+
1233
+
1234
'ip.tcp_syn_queue': {
1235
info: 'The <b>SYN queue</b> of the kernel tracks TCP handshakes until connections get fully established. ' +
1236
'It overflows when too many incoming TCP connection requests hang in the half-open state and the server ' +
@@ -1317,32 +1363,32 @@ netdataDashboard.context = {
1363
info: 'Calls to the functions responsible for closing (<a href="https://www.informit.com/articles/article.aspx?p=370047&seqNum=4" target="_blank">do_exit</a>) and releasing (<a href="https://www.informit.com/articles/article.aspx?p=370047&seqNum=4" target="_blank">release_task</a>) tasks.'
1364
},
1365
1320
- 'apps.bandwidth_sent': {
1366
+ 'apps.total_bandwidth_sent': {
1367
info: 'Bytes sent by functions <code>tcp_sendmsg</code> and <code>udp_sendmsg</code>.'
1368
},
1369
1324
- 'apps.bandwidth_recv': {
1370
+ 'apps.total_bandwidth_recv': {
1371
info: 'Bytes received by functions <code>tcp_cleanup_rbuf</code> and <code>udp_recvmsg</code>. We use <code>tcp_cleanup_rbuf</code> instead <code>tcp_recvmsg</code>, because this last misses <code>tcp_read_sock()</code> traffic and we would also need to have more probes to get the socket and package size.'
1372
},
1373
1374
'apps.bandwidth_tcp_send': {
1329
- info: 'Calls for function <code>tcp_sendmsg</code>.'
1375
+ info: 'The function <code>tcp_sendmsg</code> is used to collect number of bytes sent from TCP connections.'
1376
},
1377
1378
'apps.bandwidth_tcp_recv': {
1333
- info: 'Calls for functions <code>tcp_cleanup_rbuf</code>. We use <code>tcp_cleanup_rbuf</code> instead <code>tcp_recvmsg</code>, because this last misses <code>tcp_read_sock()</code> traffic and we would also need to have more probes to get the socket and package size.'
1379
+ info: 'The function <code>tcp_cleanup_rbuf</code> is used to collect number of bytes received from TCP connections.'
1380
},
1381
1382
'apps.bandwidth_tcp_retransmit': {
1337
- info: 'Calls for functions <code>tcp_retransmit_skb</code>.'
1383
+ info: 'The function <code>tcp_retransmit_skb</code> is called when the host did not receive the expected return from a packet sent.'
1384
},
1385
1386
'apps.bandwidth_udp_send': {
1341
- info: 'Calls for function <code>udp_sendmsg</code>.'
1387
+ info: 'The function <code>udp_sendmsg</code> is used to collect number of bytes sent from UDP connections.'
1388
},
1389
1390
'apps.bandwidth_udp_recv': {
1345
- info: 'Calls for function <code>udp_recvmsg</code>.'
1391
+ info: 'The function <code>udp_recvmsg</code> is used to collect number of bytes received from UDP connections.'
1392
},
1393
1394
'apps.dc_hit_ratio': {
@@ -3643,36 +3689,6 @@ netdataDashboard.context = {
3689
// ------------------------------------------------------------------------
3690
// eBPF
3691
3646
- 'ebpf.tcp_functions': {
3647
- title : 'TCP calls',
3648
- info: 'Successful or failed calls to functions <code>tcp_sendmsg</code>, <code>tcp_cleanup_rbuf</code> and <code>tcp_close</code>.'
3649
- },
3650
-
3651
- 'ebpf.tcp_bandwidth': {
3652
- title : 'TCP bandwidth',
3653
- info: 'Bytes sent and received for functions <code>tcp_sendmsg</code> and <code>tcp_cleanup_rbuf</code>. We use <code>tcp_cleanup_rbuf</code> instead <code>tcp_recvmsg</code>, because this last misses <code>tcp_read_sock()</code> traffic and we would also need to have more probes to get the socket and package size.'
3654
- },
3655
-
3656
- 'ebpf.tcp_retransmit': {
3657
- title : 'TCP retransmit',
3658
- info: 'Number of packets retransmitted for function <code>tcp_retransmit_skb</code>.'
3659
- },
3660
-
3661
- 'ebpf.tcp_error': {
3662
- title : 'TCP errors',
3663
- info: 'Failed calls that to functions <code>tcp_sendmsg</code>, <code>tcp_cleanup_rbuf</code> and <code>tcp_close</code>.'
3664
- },
3665
-
3666
- 'ebpf.udp_functions': {
3667
- title : 'UDP calls',
3668
- info: 'Successful or failed calls to functions <code>udp_sendmsg</code> and <code>udp_recvmsg</code>.'
3669
- },
3670
-
3671
- 'ebpf.udp_bandwidth': {
3672
- title : 'UDP bandwidth',
3673
- info: 'Bytes sent and received for functions <code>udp_sendmsg</code> and <code>udp_recvmsg</code>.'
3674
- },
3675
-
3692
'ebpf.process_thread': {
3693
title : 'Task creation',
3694
info: 'Number of times that either <a href="https://www.ece.uic.edu/~yshi1/linux/lkse/node4.html#SECTION00421000000000000000" target="_blank">do_fork</a>, or <code>kernel_clone</code> if you are running kernel newer than 5.9.16, is called to create a new task, which is the common name used to define process and tasks inside the kernel. Netdata identifies the threads by counting the number of calls for <a href="https://linux.die.net/man/2/clone" target="_blank">sys_clone</a> that has the flag <code>CLONE_THREAD</code> set.'