master
md 1,061 lines 48.5 KB
Rendered Raw
1 # Kernel traces/metrics (eBPF) collector
2
3 The Netdata Agent provides many [eBPF](https://ebpf.io/what-is-ebpf/) programs to help you troubleshoot and debug how applications interact with the Linux kernel. The `ebpf.plugin` uses [tracepoints, trampoline, and2 kprobes](#how-netdata-collects-data-using-probes-and-tracepoints) to collect a wide array of high value data about the host that would otherwise be impossible to capture.
4
5 > ❗ eBPF monitoring only works on Linux systems and with specific Linux kernels, including all kernels newer than `4.11.0`, and all kernels on CentOS 7.6 or later. For kernels older than `4.11.0`, improved support is in active development.
6
7 This document provides comprehensive details about the `ebpf.plugin`.
8 For hands-on configuration and troubleshooting tips see our [tutorial on troubleshooting apps with eBPF metrics](/docs/developer-and-contributor-corner/monitor-debug-applications-ebpf.md).
9
10 <figure>
11 <img src="https://user-images.githubusercontent.com/1153921/74746434-ad6a1e00-5222-11ea-858a-a7882617ae02.png" alt="An example of VFS charts, made possible by the eBPF collector plugin" />
12 <figcaption>An example of virtual file system (VFS) charts made possible by the eBPF collector plugin.</figcaption>
13 </figure>
14
15 ## How Netdata collects data using probes and tracepoints
16
17 Netdata uses the following features from the Linux kernel to run eBPF programs:
18
19 - Tracepoints are hooks to call specific functions. Tracepoints are more stable than `kprobes` and are preferred when
20 both options are available.
21 - Trampolines are bridges between kernel functions, and BPF programs. Netdata uses them by default whenever available.
22 - Kprobes and return probes (`kretprobe`): Probes can insert virtually into any kernel instruction. When eBPF runs in `entry` mode, it attaches only `kprobes` for internal functions monitoring calls and some arguments every time a function is called. The user can also change configuration to use [`return`](#global-configuration-options) mode, and this will allow users to monitor return from these functions and detect possible failures.
23
24 In each case, wherever a normal kprobe, kretprobe, or tracepoint would have run its hook function, an eBPF program is run instead, performing various collection logic before letting the kernel continue its normal control flow.
25
26 There are more methods to trigger eBPF programs, such as uprobes, but currently are not supported.
27
28 ## Configuring ebpf.plugin
29
30 The eBPF collector is installed and enabled by default on most new installations of the Agent.
31 If your Agent is v1.22 or older, you may to enable the collector yourself.
32
33 ### Enable the eBPF collector
34
35 To enable or disable the entire eBPF collector:
36
37 1. Navigate to the [Netdata config directory](/docs/netdata-agent/configuration/README.md#locate-your-config-directory).
38
39 ```bash
40 cd /etc/netdata
41 ```
42
43 2. Use the [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-configuration-files) script to edit `netdata.conf`.
44
45 ```bash
46 ./edit-config netdata.conf
47 ```
48
49 3. Enable the collector by scrolling down to the `[plugins]` section. Uncomment the line `ebpf` (not
50 `ebpf_process`) and set it to `yes`.
51
52 ```text
53 [plugins]
54 ebpf = yes
55 ```
56
57 ### Configure the eBPF collector
58
59 You can configure the eBPF collector's behavior to fine-tune which metrics you receive and [optimize performance](#performance-opimization).
60
61 To edit the `ebpf.d.conf`:
62
63 1. Navigate to the [Netdata config directory](/docs/netdata-agent/configuration/README.md#locate-your-config-directory).
64
65 ```bash
66 cd /etc/netdata
67 ```
68
69 2. Use the [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-configuration-files) script to edit [`ebpf.d.conf`](https://github.com/netdata/netdata/blob/master/src/collectors/ebpf.plugin/ebpf.d.conf).
70
71 ```bash
72 ./edit-config ebpf.d.conf
73 ```
74
75 You can now edit the behavior of the eBPF collector. The following sections describe each configuration option in detail.
76
77 ### `[global]` configuration options
78
79 The `[global]` section defines settings for the whole eBPF collector.
80
81 #### eBPF load mode
82
83 The collector uses two different eBPF programs. These programs rely on the same functions inside the kernel, but they
84 monitor, process, and display different kinds of information.
85
86 By default, this plugin uses the `entry` mode. Changing this mode can create significant overhead on your operating
87 system, but also offer valuable information if you are developing or debugging software. The `ebpf load mode` option
88 accepts the following values:
89
90 - `entry`: This is the default mode. In this mode, the eBPF collector only monitors calls for the functions described in
91 the sections above, and does not show charts related to errors.
92 - `return`: In the `return` mode, the eBPF collector monitors the same kernel functions as `entry`, but also creates new
93 charts for the return of these functions, such as errors. Monitoring function returns can help in debugging software,
94 such as failing to close file descriptors or creating zombie processes.
95
96 #### Integration with `apps.plugin`
97
98 The eBPF collector also creates charts for each running application through an integration with the
99 [`apps.plugin`](/src/collectors/apps.plugin/README.md). This integration helps you understand how specific applications
100 interact with the Linux kernel.
101
102 If you want to enable `apps.plugin` integration, change the "apps" setting to "yes".
103
104 ```text
105 [global]
106 apps = yes
107 ```
108
109 #### Integration with `cgroups.plugin`
110
111 The eBPF collector also creates charts for each cgroup through an integration with the
112 [`cgroups.plugin`](/src/collectors/cgroups.plugin/README.md). This integration helps you understand how a specific cgroup
113 interacts with the Linux kernel.
114
115 The integration with `cgroups.plugin` is disabled by default to avoid creating overhead on your system. If you want to
116 _enable_ the integration with `cgroups.plugin`, change the `cgroups` setting to `yes`.
117
118 ```text
119 [global]
120 cgroups = yes
121 ```
122
123 If you do not need to monitor specific metrics for your `cgroups`, you can enable `cgroups` inside
124 `ebpf.d.conf`, and then disable the plugin for a specific `thread` by following the steps in the
125 [Configuration](#configuring-ebpfplugin) section.
126
127 #### Maps per Core
128
129 When netdata is running on kernels newer than `4.6` users are allowed to modify how the `ebpf.plugin` creates maps (hash or array). When `maps per core` is defined as `yes`, plugin will create a map per core on host, on the other hand, when the value is set as `no` only one hash table will be created, this option will use less memory, but it also can increase overhead for processes.
130
131 #### Collect PID
132
133 When one of the previous integrations is enabled, `ebpf.plugin` will use Process Identifier (`PID`) to identify the
134 process group for which it needs to plot data.
135
136 There are different ways to collect PID, and you can select the way `ebpf.plugin` collects data with the following
137 values:
138
139 - `real parent`: This is the default mode. Collection will aggregate data for the real parent, the thread that creates
140 child threads.
141 - `parent`: Parent and real parent are the same when a process starts, but this value can be changed during run time.
142 - `all`: This option will store all PIDs that run on the host. Note, this method can be expensive for the host,
143 because more memory needs to be allocated and parsed.
144
145 The threads that have integration with other collectors have an internal clean up wherein they attach either a
146 `trampoline` or a `kprobe` to `release_task` internal function. To avoid `overload` on this function, `ebpf.plugin`
147 will only enable these threads integrated with other collectors when the kernel is compiled with
148 `CONFIG_DEBUG_INFO_BTF`, unless you enable them manually.
149
150 #### Collection period
151
152 The plugin uses the option `update every` to define the number of seconds used for eBPF to send data for Netdata. The default value
153 is 5 seconds.
154
155 #### PID table size
156
157 The option `pid table size` defines the maximum number of PIDs stored inside the application hash table. The default value
158 is defined according [kernel](https://elixir.bootlin.com/linux/v6.0.19/source/include/linux/threads.h#L28) source code.
159
160 #### Integration Dashboard Elements
161
162 When an integration is enabled, your dashboard will also show the following cgroups and apps charts using low-level
163 Linux metrics:
164
165 > Note: The parenthetical accompanying each bulleted item provides the chart name.
166
167 - mem
168 - Number of processes killed due out of memory. (`oomkills`)
169 - process
170 - Number of processes created with `do_fork`. (`process_create`)
171 - Number of threads created with `do_fork` or `clone (2)`, depending on your system's kernel
172 version. (`thread_create`)
173 - Number of times that a process called `do_exit`. (`task_exit`)
174 - Number of times that a process called `release_task`. (`task_close`)
175 - Number of times that an error happened to create thread or process. (`task_error`)
176 - swap
177 - Number of calls to `swap_readpage`. (`swap_read_call`)
178 - Number of calls to `swap_writepage`. (`swap_write_call`)
179 - network
180 - Number of outbound connections using TCP/IPv4. (`outbound_conn_ipv4`)
181 - Number of outbound connections using TCP/IPv6. (`outbound_conn_ipv6`)
182 - Number of bytes sent. (`total_bandwidth_sent`)
183 - Number of bytes received. (`total_bandwidth_recv`)
184 - Number of calls to `tcp_sendmsg`. (`bandwidth_tcp_send`)
185 - Number of calls to `tcp_cleanup_rbuf`. (`bandwidth_tcp_recv`)
186 - Number of calls to `tcp_retransmit_skb`. (`bandwidth_tcp_retransmit`)
187 - Number of calls to `udp_sendmsg`. (`bandwidth_udp_send`)
188 - Number of calls to `udp_recvmsg`. (`bandwidth_udp_recv`)
189 - file access
190 - Number of calls to open files. (`file_open`)
191 - Number of calls to open files that returned errors. (`open_error`)
192 - Number of files closed. (`file_closed`)
193 - Number of calls to close files that returned errors. (`file_error_closed`)
194 - vfs
195 - Number of calls to `vfs_unlink`. (`file_deleted`)
196 - Number of calls to `vfs_write`. (`vfs_write_call`)
197 - Number of calls to write a file that returned errors. (`vfs_write_error`)
198 - Number of calls to `vfs_read`. (`vfs_read_call`)
199 - - Number of calls to read a file that returned errors. (`vfs_read_error`)
200 - Number of bytes written with `vfs_write`. (`vfs_write_bytes`)
201 - Number of bytes read with `vfs_read`. (`vfs_read_bytes`)
202 - Number of calls to `vfs_fsync`. (`vfs_fsync`)
203 - Number of calls to sync file that returned errors. (`vfs_fsync_error`)
204 - Number of calls to `vfs_open`. (`vfs_open`)
205 - Number of calls to open file that returned errors. (`vfs_open_error`)
206 - Number of calls to `vfs_create`. (`vfs_create`)
207 - Number of calls to open file that returned errors. (`vfs_create_error`)
208 - page cache
209 - Ratio of pages accessed. (`cachestat_ratio`)
210 - Number of modified pages ("dirty"). (`cachestat_dirties`)
211 - Number of accessed pages. (`cachestat_hits`)
212 - Number of pages brought from disk. (`cachestat_misses`)
213 - directory cache
214 - Ratio of files available in directory cache. (`dc_hit_ratio`)
215 - Number of files accessed. (`dc_reference`)
216 - Number of files accessed that were not in cache. (`dc_not_cache`)
217 - Number of files not found. (`dc_not_found`)
218 - ipc shm
219 - Number of calls to `shm_get`. (`shmget_call`)
220 - Number of calls to `shm_at`. (`shmat_call`)
221 - Number of calls to `shm_dt`. (`shmdt_call`)
222 - Number of calls to `shm_ctl`. (`shmctl_call`)
223
224 ### `[ebpf programs]` configuration options
225
226 The eBPF collector enables and runs the following eBPF programs by default:
227
228 - `cachestat`: Netdata's eBPF data collector creates charts about the memory page cache. When the integration with
229 [`apps.plugin`](/src/collectors/apps.plugin/README.md) is enabled, this collector creates charts for the whole host _and_
230 for each application.
231 - `fd` : This eBPF program creates charts that show information about calls to open files.
232 - `mount`: This eBPF program creates charts that show calls to syscalls mount(2) and umount(2).
233 - `shm`: This eBPF program creates charts that show calls to syscalls shmget(2), shmat(2), shmdt(2) and shmctl(2).
234 - `process`: This eBPF program creates charts that show information about process life. When in `return` mode, it also
235 creates charts showing errors when these operations are executed.
236 - `hardirq`: This eBPF program creates charts that show information about time spent servicing individual hardware
237 interrupt requests (hard IRQs).
238 - `softirq`: This eBPF program creates charts that show information about time spent servicing individual software
239 interrupt requests (soft IRQs).
240 - `oomkill`: This eBPF program creates a chart that shows OOM kills for all applications recognized via
241 the `apps.plugin` integration. Note that this program will show application charts regardless of whether apps
242 integration is turned on or off.
243
244 You can also enable the following eBPF programs:
245
246 - `dcstat` : This eBPF program creates charts that show information about file access using directory cache. It appends
247 `kprobes` for `lookup_fast()` and `d_lookup()` to identify if files are inside directory cache, outside and files are
248 not found.
249 - `disk` : This eBPF program creates charts that show information about disk latency independent of filesystem.
250 - `filesystem` : This eBPF program creates charts that show information about some filesystem latency.
251 - `swap` : This eBPF program creates charts that show information about swap access.
252 - `mdflush`: This eBPF program creates charts that show information about
253 - `sync`: Monitor calls to syscalls sync(2), fsync(2), fdatasync(2), syncfs(2), msync(2), and sync_file_range(2).
254 - `socket`: This eBPF program creates charts with information about `TCP` and `UDP` functions, including the
255 bandwidth consumed by each.
256 multi-device software flushes.
257 - `vfs`: This eBPF program creates charts that show information about VFS (Virtual File System) functions.
258
259 ### Configuring eBPF threads
260
261 You can configure each thread of the eBPF data collector. This allows you to overwrite global options defined in `/etc/netdata/ebpf.d.conf` and configure specific options for each thread.
262
263 To configure an eBPF thread:
264
265 1. Navigate to the [Netdata config directory](/docs/netdata-agent/configuration/README.md#locate-your-config-directory).
266
267 ```bash
268 cd /etc/netdata
269 ```
270
271 2. Use the [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-configuration-files) script to edit a thread configuration file. The following configuration files are available:
272
273 - `network.conf`: Configuration for the [`network` thread](#network-configuration). This config file overwrites the global options and also
274 lets you specify which network the eBPF collector monitors.
275 - `process.conf`: Configuration for the [`process` thread](#sync-configuration).
276 - `cachestat.conf`: Configuration for the `cachestat` thread(#filesystem-configuration).
277 - `dcstat.conf`: Configuration for the `dcstat` thread.
278 - `disk.conf`: Configuration for the `disk` thread.
279 - `fd.conf`: Configuration for the `file descriptor` thread.
280 - `filesystem.conf`: Configuration for the `filesystem` thread.
281 - `hardirq.conf`: Configuration for the `hardirq` thread.
282 - `softirq.conf`: Configuration for the `softirq` thread.
283 - `sync.conf`: Configuration for the `sync` thread.
284 - `vfs.conf`: Configuration for the `vfs` thread.
285
286 ```bash
287 ./edit-config FILE.conf
288 ```
289
290 ### Network configuration
291
292 The network configuration has specific options to configure which network(s) the eBPF collector monitors. These options
293 are divided in the following sections:
294
295 #### `[network connections]`
296
297 You can configure the information shown with function `ebpf_socket` using the settings in this section.
298
299 ```text
300 [network connections]
301 enabled = yes
302 resolve hostname ips = no
303 resolve service names = yes
304 ports = 1-1024 !145 !domain
305 hostnames = !example.com
306 ips = !127.0.0.1/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 fc00::/7
307 ```
308
309 When you define a `ports` setting, Netdata will collect network metrics for that specific port. For example, if you
310 write `ports = 19999`, Netdata will collect only connections for itself. The `hostnames` setting accepts
311 [simple patterns](/src/libnetdata/simple_pattern/README.md). The `ports`, and `ips` settings accept negation (`!`) to deny
312 specific values or asterisk alone to define all values.
313
314 In the above example, Netdata will collect metrics for all ports between `1` and `1024`, with the exception of `53` (domain)
315 and `145`.
316
317 The following options are available:
318
319 - `enabled`: Disable network connections monitoring. This can affect directly some funcion output.
320 - `resolve hostname ips`: Enable resolving IPs to hostnames. It is disabled by default because it can be too slow.
321 - `resolve service names`: Convert destination ports into service names, for example, port `53` protocol `UDP` becomes `domain`.
322 all names are read from /etc/services.
323 - `ports`: Define the destination ports for Netdata to monitor.
324 - `hostnames`: The list of hostnames that can be resolved to an IP address.
325 - `ips`: The IP or range of IPs that you want to monitor. You can use IPv4 or IPv6 addresses, use dashes to define a
326 range of IPs, or use CIDR values.
327
328 By default the traffic table is created using the destination IPs and ports of the sockets. This can be
329 changed, so that Netdata uses service names (if possible), by specifying `resolve service name = yes` in the configuration
330 section.
331
332 #### `[service name]`
333
334 Netdata uses the list of services in `/etc/services` to plot network connection charts. If this file does not contain
335 the name for a particular service you use in your infrastructure, you will need to add it to the `[service name]`
336 section.
337
338 For example, Netdata's default port (`19999`) is not listed in `/etc/services`. To associate that port with the Netdata
339 service in network connection charts, and thus see the name of the service instead of its port, define it:
340
341 ```text
342 [service name]
343 19999 = Netdata
344 ```
345
346 ### Sync configuration
347
348 The sync configuration has specific options to disable monitoring for syscalls. All syscalls are monitored by default.
349
350 ```text
351 [syscalls]
352 sync = yes
353 msync = yes
354 fsync = yes
355 fdatasync = yes
356 syncfs = yes
357 sync_file_range = yes
358 ```
359
360 ### Filesystem configuration
361
362 The filesystem configuration has specific options to disable monitoring for filesystems; by default, all filesystems are
363 monitored.
364
365 ```text
366 [filesystem]
367 btrfsdist = yes
368 ext4dist = yes
369 nfsdist = yes
370 xfsdist = yes
371 zfsdist = yes
372 ```
373
374 The ebpf program `nfsdist` monitors only `nfs` mount points.
375
376 ## Troubleshooting
377
378 If the eBPF collector does not work, you can troubleshoot it by running the `ebpf.plugin` command and investigating its
379 output.
380
381 ```bash
382 cd /usr/libexec/netdata/plugins.d/
383 sudo su -s /bin/bash ./ebpf.plugin
384 ```
385
386 You can also use `grep` to search the Agent's `error.log` for messages related to eBPF monitoring.
387
388 ```bash
389 grep -i ebpf /var/log/netdata/error.log
390 ```
391
392 ### Confirm kernel compatibility
393
394 The eBPF collector only works on Linux systems and with specific Linux kernels. We support all kernels more recent than
395 `4.11.0`, and all kernels on CentOS 7.6 or later.
396
397 You can run our helper script to determine whether your system can support eBPF monitoring. If it returns no output, your system is ready to compile and run the eBPF collector.
398
399 ```bash
400 curl -sSL https://raw.githubusercontent.com/netdata/kernel-collector/master/tools/check-kernel-config.sh | sudo bash
401 ```
402
403 If you see a warning about a missing kernel
404 configuration (`KPROBES KPROBES_ON_FTRACE HAVE_KPROBES BPF BPF_SYSCALL BPF_JIT`), you will need to recompile your kernel
405 to support this configuration. The process of recompiling Linux kernels varies based on your distribution and version.
406 Read the documentation for your system's distribution to learn more about the specific workflow for recompiling the
407 kernel, ensuring that you set all the necessary
408
409 - [Ubuntu](https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel)
410 - [Debian](https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-official)
411 - [Fedora](https://fedoraproject.org/wiki/Building_a_custom_kernel)
412 - [CentOS](https://wiki.centos.org/HowTos/Custom_Kernel)
413 - [Arch Linux](https://wiki.archlinux.org/index.php/Kernel/Traditional_compilation)
414 - [Slackware](https://docs.slackware.com/howtos:slackware_admin:kernelbuilding)
415
416 ### Mount `debugfs` and `tracefs`
417
418 The eBPF collector also requires both the `tracefs` and `debugfs` filesystems. Try mounting the `tracefs` and `debugfs`
419 filesystems using the commands below:
420
421 ```bash
422 sudo mount -t debugfs nodev /sys/kernel/debug
423 sudo mount -t tracefs nodev /sys/kernel/tracing
424 ```
425
426 If they are already mounted, you will see an error. You can also configure your system's `/etc/fstab` configuration to
427 mount these filesystems on startup. More information can be found in
428 the [ftrace documentation](https://www.kernel.org/doc/Documentation/trace/ftrace.txt).
429
430 ## Charts
431
432 The eBPF collector creates charts on different menus, like System Overview, Memory, MD arrays, Disks, Filesystem,
433 Mount Points, Networking Stack, systemd Services, and Applications.
434
435 The collector stores the actual value inside of its process, but charts only show the difference between the values
436 collected in the previous and current seconds.
437
438 ### System overview
439
440 Not all charts within the System Overview menu are enabled by default. Charts that rely on `kprobes` are disabled by default because they add around 100ns overhead for each function call. This is a small number from a human's perspective, but the functions are called many times and create an impact
441 on host. See the [configuration](#configuring-ebpfplugin) section for details about how to enable them.
442
443 #### Processes
444
445 Internally, the Linux kernel treats both processes and threads as `tasks`. To create a thread, the kernel offers a few
446 system calls: `fork(2)`, `vfork(2)`, and `clone(2)`. To generate this chart, the eBPF
447 collector uses the following `tracepoints` and `kprobe`:
448
449 - `sched/sched_process_fork`: Tracepoint called after a call for `fork (2)`, `vfork (2)` and `clone (2)`.
450 - `sched/sched_process_exec`: Tracepoint called after a exec-family syscall.
451 - `kprobe/kernel_clone`: This is the main [`fork()`](https://elixir.bootlin.com/linux/v5.10/source/kernel/fork.c#L2415)
452 routine since kernel `5.10.0` was released.
453 - `kprobe/_do_fork`: Like `kernel_clone`, but this was the main function between kernels `4.2.0` and `5.9.16`
454 - `kprobe/do_fork`: This was the main function before kernel `4.2.0`.
455
456 #### Process Exit
457
458 Ending a task requires two steps. The first is a call to the internal function `do_exit`, which notifies the operating
459 system that the task is finishing its work. The second step is to release the kernel information with the internal
460 function `release_task`. The difference between the two dimensions can help you discover
461 [zombie processes](https://en.wikipedia.org/wiki/Zombie_process). To get the metrics, the collector uses:
462
463 - `sched/sched_process_exit`: Tracepoint called after a task exits.
464 - `kprobe/release_task`: This function is called when a process exits, as the kernel still needs to remove the process
465 descriptor.
466
467 #### Task error
468
469 The functions responsible for ending tasks do not return values, so this chart contains information about failures on
470 process and thread creation only.
471
472 #### Swap
473
474 Inside the swap submenu the eBPF plugin creates the chart `swapcalls`; this chart is displaying when processes are
475 calling functions [`swap_readpage` and `swap_writepage`](https://hzliu123.github.io/linux-kernel/Page%20Cache%20in%20Linux%202.6.pdf),
476 which are functions responsible for doing IO in swap memory. To collect the exact moment that an access to swap happens,
477 the collector attaches `kprobes` for cited functions.
478
479 #### Soft IRQ
480
481 The following `tracepoints` are used to measure time usage for soft IRQs:
482
483 - [`irq/softirq_entry`](https://www.kernel.org/doc/html/latest/core-api/tracepoint.html#c.trace_softirq_entry): Called
484 before softirq handler
485 - [`irq/softirq_exit`](https://www.kernel.org/doc/html/latest/core-api/tracepoint.html#c.trace_softirq_exit): Called when
486 softirq handler returns.
487
488 #### Hard IRQ
489
490 The following tracepoints are used to measure the latency of servicing a
491 hardware interrupt request (hard IRQ).
492
493 - [`irq/irq_handler_entry`](https://www.kernel.org/doc/html/latest/core-api/tracepoint.html#c.trace_irq_handler_entry):
494 Called immediately before the IRQ action handler.
495 - [`irq/irq_handler_exit`](https://www.kernel.org/doc/html/latest/core-api/tracepoint.html#c.trace_irq_handler_exit):
496 Called immediately after the IRQ action handler returns.
497 - `irq_vectors`: These are traces from `irq_handler_entry` and
498 `irq_handler_exit` when an IRQ is handled. The following elements from vector
499 are triggered:
500 - `irq_vectors/local_timer_entry`
501 - `irq_vectors/local_timer_exit`
502 - `irq_vectors/reschedule_entry`
503 - `irq_vectors/reschedule_exit`
504 - `irq_vectors/call_function_entry`
505 - `irq_vectors/call_function_exit`
506 - `irq_vectors/call_function_single_entry`
507 - `irq_vectors/call_function_single_xit`
508 - `irq_vectors/irq_work_entry`
509 - `irq_vectors/irq_work_exit`
510 - `irq_vectors/error_apic_entry`
511 - `irq_vectors/error_apic_exit`
512 - `irq_vectors/thermal_apic_entry`
513 - `irq_vectors/thermal_apic_exit`
514 - `irq_vectors/threshold_apic_entry`
515 - `irq_vectors/threshold_apic_exit`
516 - `irq_vectors/deferred_error_entry`
517 - `irq_vectors/deferred_error_exit`
518 - `irq_vectors/spurious_apic_entry`
519 - `irq_vectors/spurious_apic_exit`
520 - `irq_vectors/x86_platform_ipi_entry`
521 - `irq_vectors/x86_platform_ipi_exit`
522
523 #### IPC shared memory
524
525 To monitor shared memory system call counts, Netdata attaches tracing in the following functions:
526
527 - `shmget`: Runs when [`shmget`](https://man7.org/linux/man-pages/man2/shmget.2.html) is called.
528 - `shmat`: Runs when [`shmat`](https://man7.org/linux/man-pages/man2/shmat.2.html) is called.
529 - `shmdt`: Runs when [`shmdt`](https://man7.org/linux/man-pages/man2/shmat.2.html) is called.
530 - `shmctl`: Runs when [`shmctl`](https://man7.org/linux/man-pages/man2/shmctl.2.html) is called.
531
532 ### Memory
533
534 In the memory submenu the eBPF plugin creates two submenus **page cache** and **synchronization** with the following
535 organization:
536
537 - Page Cache
538 - Page cache ratio
539 - Dirty pages
540 - Page cache hits
541 - Page cache misses
542 - Synchronization
543 - File sync
544 - Memory map sync
545 - File system sync
546 - File range sync
547
548 #### Page cache hits
549
550 When the processor needs to read or write a location in main memory, it checks for a corresponding entry in the page cache.
551 If the entry is there, a page cache hit has occurred and the read is from the cache.
552
553 A page cache hit is when the page cache is successfully accessed with a read operation. We do not count pages that were
554 added relatively recently.
555
556 #### Dirty pages
557
558 A "dirty page" is a page in the page cache that was modified after being created. Since non-dirty pages in the page cache
559 have identical copies in secondary storage (e.g. hard disk drive or solid-state drive), discarding and reusing their space
560 is much quicker than paging out application memory, and is often preferred over flushing the dirty pages into secondary storage
561 and reusing their space.
562
563 On `cachestat_dirties` Netdata demonstrates the number of pages that were modified. This chart shows the number of calls
564 to the function `mark_buffer_dirty`.
565
566 #### Page cache ratio
567
568 When the processor needs to read or write in a specific memory address, it checks for a corresponding entry in the page cache.
569 If the processor hits a page cache (`page cache hit`), it reads the entry from the cache. If there is no entry (`page cache miss`),
570 the kernel allocates a new entry and copies data from the disk. Netdata calculates the percentage of accessed files that are cached on
571 memory. The ratio is calculated counting the accessed cached pages
572 (without counting [dirty pages](#dirty-pages) and pages added because of read misses) divided by total access without dirty pages.
573
574 > \_\_**\_\_\_\_**<ins>Number of accessed cached pages</ins>\***\*\_\_\*\***<br/>
575 > Number of total accessed pages - dirty pages - missed pages
576
577 The chart `cachestat_ratio` shows how processes are accessing page cache. In a normal scenario, we expect values around
578 100%, which means that the majority of the work on the machine is processed in memory. To calculate the ratio, Netdata
579 attaches `kprobes` for kernel functions:
580
581 - `add_to_page_cache_lru`: Page addition.
582 - `mark_page_accessed`: Access to cache.
583 - `account_page_dirtied`: Dirty (modified) pages.
584 - `mark_buffer_dirty`: Writes to page cache.
585
586 #### Page cache misses
587
588 A page cache miss means that a page was not inside memory when the process tried to access it. This chart shows the
589 result of the difference for calls between functions `add_to_page_cache_lru` and `account_page_dirtied`.
590
591 #### File sync
592
593 This chart shows calls to synchronization methods, [`fsync(2)`](https://man7.org/linux/man-pages/man2/fdatasync.2.html)
594 and [`fdatasync(2)`](https://man7.org/linux/man-pages/man2/fdatasync.2.html), to transfer all modified page caches
595 for the files on disk devices. These calls block until the disk reports that the transfer has been completed. They flush
596 data for specific file descriptors.
597
598 #### Memory map sync
599
600 The chart shows calls to [`msync(2)`](https://man7.org/linux/man-pages/man2/msync.2.html) syscalls. This syscall flushes
601 changes to a file that was mapped into memory using [`mmap(2)`](https://man7.org/linux/man-pages/man2/mmap.2.html).
602
603 #### File system sync
604
605 This chart monitors calls demonstrating commits from filesystem caches to disk. Netdata attaches `tracing` for
606 [`sync(2)`](https://man7.org/linux/man-pages/man2/sync.2.html), and [`syncfs(2)`](https://man7.org/linux/man-pages/man2/sync.2.html).
607
608 #### File range sync
609
610 This chart shows calls to [`sync_file_range(2)`](https://man7.org/linux/man-pages/man2/sync_file_range.2.html) which
611 synchronizes file segments with disk.
612
613 > Note: This is the most dangerous syscall to synchronize data, according to its manual.
614
615 ### Multiple Device (MD) arrays
616
617 The eBPF plugin shows multi-device flushes happening in real time. This can be used to explain some spikes happening
618 in [disk latency](#disk) charts.
619
620 By default, MD flush is disabled. To enable it, configure your
621 `/etc/netdata/ebpf.d.conf` file as:
622
623 ```text
624 [global]
625 mdflush = yes
626 ```
627
628 #### MD flush
629
630 To collect data related to Linux multi-device (MD) flushing, the following kprobe is used:
631
632 - `kprobe/md_flush_request`: called whenever a request for flushing multi-device data is made.
633
634 ### Disk
635
636 The eBPF plugin also shows a chart in the Disk section when the `disk` thread is enabled.
637
638 #### Disk Latency
639
640 This will create the chart `disk_latency_io` for each disk on the host. The following tracepoints are used:
641
642 - [`block/block_rq_issue`](https://www.kernel.org/doc/html/latest/core-api/tracepoint.html#c.trace_block_rq_issue):
643 IO request operation to a device drive.
644 - [`block/block_rq_complete`](https://www.kernel.org/doc/html/latest/core-api/tracepoint.html#c.trace_block_rq_complete):
645 IO operation completed by device.
646
647 Disk Latency is the single most important metric to focus on when it comes to storage performance, under most circumstances.
648 For hard drives, an average latency somewhere between 10 to 20 ms can be considered acceptable. For SSD (Solid State Drives),
649 in most cases, workloads experience less than 1 ms latency numbers, but workloads should never reach higher than 3 ms.
650 The dimensions refer to time intervals.
651
652 ### Filesystem
653
654 This group has charts demonstrating how applications interact with the Linux kernel to open and close file descriptors.
655 It also brings latency charts for several different filesystems.
656
657 #### Latency Algorithm
658
659 We calculate the difference between the calling and return times, spanning disk I/O, file system operations (lock, I/O),
660 run queue latency and all events related to the monitored action.
661
662 #### ext4
663
664 To measure the latency of executing some actions in an
665 [ext4](https://elixir.bootlin.com/linux/latest/source/fs/ext4) filesystem, the
666 collector needs to attach `kprobes` and `kretprobes` for each of the following
667 functions:
668
669 - `ext4_file_read_iter`: Function used to measure read latency.
670 - `ext4_file_write_iter`: Function used to measure write latency.
671 - `ext4_file_open`: Function used to measure open latency.
672 - `ext4_sync_file`: Function used to measure sync latency.
673
674 #### ZFS
675
676 To measure the latency of executing some actions in a zfs filesystem, the
677 collector needs to attach `kprobes` and `kretprobes` for each of the following
678 functions:
679
680 - `zpl_iter_read`: Function used to measure read latency.
681 - `zpl_iter_write`: Function used to measure write latency.
682 - `zpl_open`: Function used to measure open latency.
683 - `zpl_fsync`: Function used to measure sync latency.
684
685 #### XFS
686
687 To measure the latency of executing some actions in an
688 [xfs](https://elixir.bootlin.com/linux/latest/source/fs/xfs) filesystem, the
689 collector needs to attach `kprobes` and `kretprobes` for each of the following
690 functions:
691
692 - `xfs_file_read_iter`: Function used to measure read latency.
693 - `xfs_file_write_iter`: Function used to measure write latency.
694 - `xfs_file_open`: Function used to measure open latency.
695 - `xfs_file_fsync`: Function used to measure sync latency.
696
697 #### NFS
698
699 To measure the latency of executing some actions in an
700 [nfs](https://elixir.bootlin.com/linux/latest/source/fs/nfs) filesystem, the
701 collector needs to attach `kprobes` and `kretprobes` for each of the following
702 functions:
703
704 - `nfs_file_read`: Function used to measure read latency.
705 - `nfs_file_write`: Function used to measure write latency.
706 - `nfs_file_open`: Functions used to measure open latency.
707 - `nfs4_file_open`: Functions used to measure open latency for NFS v4.
708 - `nfs_getattr`: Function used to measure sync latency.
709
710 #### btrfs
711
712 To measure the latency of executing some actions in a [btrfs](https://elixir.bootlin.com/linux/latest/source/fs/btrfs/file.c)
713 filesystem, the collector needs to attach `kprobes` and `kretprobes` for each of the following functions:
714
715 > Note: We are listing two functions used to measure `read` latency, but we use either `btrfs_file_read_iter` or
716 > `generic_file_read_iter`, depending on kernel version.
717
718 - `btrfs_file_read_iter`: Function used to measure read latency since kernel `5.10.0`.
719 - `generic_file_read_iter`: Like `btrfs_file_read_iter`, but this function was used before kernel `5.10.0`.
720 - `btrfs_file_write_iter`: Function used to write data.
721 - `btrfs_file_open`: Function used to open files.
722 - `btrfs_sync_file`: Function used to synchronize data to filesystem.
723
724 #### File descriptor
725
726 To give metrics related to `open` and `close` events, instead of attaching kprobes for each syscall used to do these
727 events, the collector attaches `kprobes` for the common function used for syscalls:
728
729 - [`do_sys_open`](https://0xax.gitbooks.io/linux-insides/content/SysCall/linux-syscall-5.html): Internal function used to
730 open files.
731 - [`do_sys_openat2`](https://elixir.bootlin.com/linux/v5.6/source/fs/open.c#L1162):
732 Function called from `do_sys_open` since version `5.6.0`.
733 - [`close_fd`](https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2271761.html): Function used to close file
734 descriptor since kernel `5.11.0`.
735 - `__close_fd`: Function used to close files before version `5.11.0`.
736
737 #### File error
738
739 This chart shows the number of times some software tried and failed to open or close a file descriptor.
740
741 #### VFS
742
743 The Linux Virtual File System (VFS) is an abstraction layer on top of a
744 concrete filesystem like the ones listed in the parent section, e.g. `ext4`.
745
746 In this section we list the mechanism by which we gather VFS data, and what
747 charts are consequently created.
748
749 ##### VFS eBPF Hooks
750
751 To measure the latency and total quantity of executing some VFS-level
752 functions, ebpf.plugin needs to attach kprobes and kretprobes for each of the
753 following functions:
754
755 - `vfs_write`: Function used monitoring the number of successful & failed
756 filesystem write calls, as well as the total number of written bytes.
757 - `vfs_writev`: Same function as `vfs_write` but for vector writes (i.e. a
758 single write operation using a group of buffers rather than 1).
759 - `vfs_read`: Function used for monitoring the number of successful & failed
760 filesystem read calls, as well as the total number of read bytes.
761 - `vfs_readv` Same function as `vfs_read` but for vector reads (i.e. a single
762 read operation using a group of buffers rather than 1).
763 - `vfs_unlink`: Function used for monitoring the number of successful & failed
764 filesystem unlink calls.
765 - `vfs_fsync`: Function used for monitoring the number of successful & failed
766 filesystem fsync calls.
767 - `vfs_open`: Function used for monitoring the number of successful & failed
768 filesystem open calls.
769 - `vfs_create`: Function used for monitoring the number of successful & failed
770 filesystem create calls.
771
772 ##### VFS Deleted objects
773
774 This chart monitors calls to `vfs_unlink`. This function is responsible for removing objects from the file system.
775
776 ##### VFS IO
777
778 This chart shows the number of calls to the functions `vfs_read` and `vfs_write`.
779
780 ##### VFS IO bytes
781
782 This chart also monitors `vfs_read` and `vfs_write` but, instead of the number of calls, it shows the total amount of
783 bytes read and written with these functions.
784
785 The Agent displays the number of bytes written as negative because they are moving down to disk.
786
787 ##### VFS IO errors
788
789 The Agent counts and shows the number of instances where a running program experiences a read or write error.
790
791 ##### VFS Create
792
793 This chart shows the number of calls to `vfs_create`. This function is responsible for creating files.
794
795 ##### VFS Synchronization
796
797 This chart shows the number of calls to `vfs_fsync`. This function is responsible for calling `fsync(2)` or
798 `fdatasync(2)` on a file. You can see more details in the Synchronization section.
799
800 ##### VFS Open
801
802 This chart shows the number of calls to `vfs_open`. This function is responsible for opening files.
803
804 #### Directory Cache
805
806 Metrics for directory cache are collected using kprobe for `lookup_fast`, because we are interested in the number of
807 times this function is accessed. On the other hand, for `d_lookup` we are not only interested in the number of times it
808 is accessed, but also in possible errors, so we need to attach a `kretprobe`. For this reason, the following is used:
809
810 - [`lookup_fast`](https://lwn.net/Articles/649115/): Called to look at data inside the directory cache.
811 - [`d_lookup`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/dcache.c?id=052b398a43a7de8c68c13e7fa05d6b3d16ce6801#n2223):
812 Called when the desired file is not inside the directory cache.
813
814 ##### Directory Cache Interpretation
815
816 When directory cache is showing 100% that means that every accessed file was present in the directory cache.
817 If files are not present in the directory cache, they are either not present in the file system or the files were not
818 accessed before.
819
820 ### Mount Points
821
822 The following `tracing` are used to collect `mount` & `unmount` call counts:
823
824 - [`mount`](https://man7.org/linux/man-pages/man2/mount.2.html): mount filesystem on host.
825 - [`umount`](https://man7.org/linux/man-pages/man2/umount.2.html): umount filesystem on host.
826
827 ### Networking Stack
828
829 Netdata monitors socket bandwidth attaching `tracing` for internal functions.
830
831 #### TCP outbound connections
832
833 This chart demonstrates calls to `tcp_v4_connection` and `tcp_v6_connection` that start connections for IPV4 and IPV6, respectively.
834
835 #### TCP inbound connections
836
837 This chart demonstrates TCP and UDP connections that the host receives.
838 To collect this information, netdata attaches a tracing to `inet_csk_accept`.
839
840 #### TCP bandwidth functions
841
842 This chart demonstrates calls to functions `tcp_sendmsg`, `tcp_cleanup_rbuf`, and `tcp_close`; these functions are used
843 to send & receive data and to close connections when `TCP` protocol is used.
844
845 #### TCP bandwidth
846
847 This chart demonstrates calls to functions:
848
849 - `tcp_sendmsg`: Function responsible to send data for a specified destination.
850 - `tcp_cleanup_rbuf`: We use this function instead of `tcp_recvmsg`, because the last one misses `tcp_read_sock` traffic
851 and we would also need to add more `tracing` to get the socket and package size.
852 - `tcp_close`: Function responsible to close connection.
853
854 #### TCP retransmit
855
856 This chart demonstrates calls to function `tcp_retransmit` that is responsible for executing TCP retransmission when the
857 receiver did not return the packet during the expected time.
858
859 #### UDP functions
860
861 This chart demonstrates calls to functions `udp_sendmsg` and `udp_recvmsg`, which are responsible for sending &
862 receiving data for connections when the `UDP` protocol is used.
863
864 #### UDP bandwidth
865
866 Like the previous chart, this one also monitors `udp_sendmsg` and `udp_recvmsg`, but instead of showing the number of
867 calls, it monitors the number of bytes sent and received.
868
869 ### Apps
870
871 #### OOM Killing
872
873 These are tracepoints related to [OOM](https://en.wikipedia.org/wiki/Out_of_memory) killing processes.
874
875 - `oom/mark_victim`: Monitors when an oomkill event happens.
876
877 ## Known issues
878
879 ### Performance opimization
880
881 eBPF monitoring is complex and produces a large volume of metrics. We've discovered scenarios where the eBPF plugin
882 significantly increases kernel memory usage by several hundred MB.
883
884 When the integration with apps or cgroup is enabled, the eBPF collector allocates memory for each process running. If your
885 node is experiencing high memory usage and there is no obvious culprit to be found in the `apps.mem` chart, consider:
886
887 - Modify [maps per core](#maps-per-core) to use only one map.
888 - Disable [integration with apps](#integration-with-appsplugin).
889 - Disable [integration with cgroup](#integration-with-cgroupsplugin).
890
891 If with these changes you still suspect eBPF using too much memory, and there is no obvious culprit to be found
892 in the `apps.mem` chart, consider testing for high kernel memory usage by [disabling eBPF monitoring](#configuring-ebpfplugin).
893 Next, [restart Netdata](/docs/netdata-agent/start-stop-restart.md) to see if system memory usage (see the `system.ram` chart) has dropped significantly.
894
895 Beginning with `v1.31`, kernel memory usage is configurable via the [`pid table size` setting](#pid-table-size)
896 in `ebpf.conf`.
897
898 The total memory usage is a well known [issue](https://lore.kernel.org/all/167821082315.1693.6957546778534183486.git-patchwork-notify@kernel.org/)
899 for eBPF, this is not a bug present in plugin.
900
901 ### SELinux
902
903 When [SELinux](https://www.redhat.com/en/topics/linux/what-is-selinux) is enabled, it may prevent `ebpf.plugin` from
904 starting correctly. Check the Agent's `error.log` file for errors like the ones below:
905
906 ```bash
907 2020-06-14 15:32:08: ebpf.plugin ERROR : EBPF PROCESS : Cannot load program: /usr/libexec/netdata/plugins.d/pnetdata_ebpf_process.3.10.0.o (errno 13, Permission denied)
908 2020-06-14 15:32:19: netdata ERROR : PLUGINSD[ebpf] : read failed: end of file (errno 9, Bad file descriptor)
909 ```
910
911 You can also check for errors related to `ebpf.plugin` inside `/var/log/audit/audit.log`:
912
913 ```bash
914 type=AVC msg=audit(1586260134.952:97): avc: denied { map_create } for pid=1387 comm="ebpf.pl" scontext=system_u:system_r:unconfined_service_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=bpf permissive=0
915 type=SYSCALL msg=audit(1586260134.952:97): arch=c000003e syscall=321 success=no exit=-13 a0=0 a1=7ffe6b36f000 a2=70 a3=0 items=0 ppid=1135 pid=1387 auid=4294967295 uid=994 gid=990 euid=0 suid=0 fsuid=0 egid=990 sgid=990 fsgid=990 tty=(none) ses=4294967295 comm="ebpf_proc
916 ess.pl" exe="/usr/libexec/netdata/plugins.d/ebpf.plugin" subj=system_u:system_r:unconfined_service_t:s0 key=(null)
917 ```
918
919 If you see similar errors, you will have to adjust SELinux's policies to enable the eBPF collector.
920
921 #### Creation of bpf policies
922
923 To enable `ebpf.plugin` to run on a distribution with SELinux enabled, it will be necessary to take the following
924 actions.
925
926 First, stop the Netdata Agent.
927
928 ```bash
929 # systemctl stop netdata
930 ```
931
932 Next, create a policy with the `audit.log` file you examined earlier.
933
934 ```bash
935 # grep ebpf.plugin /var/log/audit/audit.log | audit2allow -M netdata_ebpf
936 ```
937
938 This will create two new files: `netdata_ebpf.te` and `netdata_ebpf.mod`.
939
940 Edit the `netdata_ebpf.te` file to change the options `class` and `allow`. You should have the following at the end of
941 the `netdata_ebpf.te` file.
942
943 ```text
944 module netdata_ebpf 1.0;
945 require {
946 type unconfined_service_t;
947 class bpf { map_create map_read map_write prog_load prog_run };
948 }
949 #============= unconfined_service_t ==============
950 allow unconfined_service_t self:bpf { map_create map_read map_write prog_load prog_run };
951 ```
952
953 Then compile your `netdata_ebpf.te` file with the following commands to create a binary that loads the new policies:
954
955 ```bash
956 # checkmodule -M -m -o netdata_ebpf.mod netdata_ebpf.te
957 # semodule_package -o netdata_ebpf.pp -m netdata_ebpf.mod
958 ```
959
960 Finally, you can load the new policy and start the Netdata Agent again:
961
962 ```bash
963 # semodule -i netdata_ebpf.pp
964 # systemctl start netdata
965 ```
966
967 ### Linux kernel lockdown
968
969 Beginning with [version 5.4](https://www.zdnet.com/article/linux-to-get-kernel-lockdown-feature/), the Linux kernel has
970 a feature called "lockdown," which may affect `ebpf.plugin` depending how the kernel was compiled. The following table
971 shows how the lockdown module impacts `ebpf.plugin` based on the selected options:
972
973 | Enforcing kernel lockdown | Enable lockdown LSM early in init | Default lockdown mode | Can `ebpf.plugin` run with this? |
974 |:--------------------------|:----------------------------------|:----------------------|:---------------------------------|
975 | YES | NO | NO | YES |
976 | YES | Yes | None | YES |
977 | YES | Yes | Integrity | YES |
978 | YES | Yes | Confidentiality | NO |
979
980 If you or your distribution compiled the kernel with the last combination, your system cannot load shared libraries
981 required to run `ebpf.plugin`.
982
983 ## Functions
984
985 ### ebpf_thread
986
987 The eBPF plugin has a [function](/docs/top-monitoring-netdata-functions.md) named
988 `ebpf_thread` that controls its internal threads and helps to reduce the overhead on host. Using the function you
989 can run the plugin with all threads disabled and enable them only when you want to take a look in specific areas.
990
991 #### List threads
992
993 To list all threads status you can query directly the endpoint function:
994
995 `http://localhost:19999/api/v1/function?function=ebpf_thread`
996
997 It is also possible to query a specific thread adding keyword `thread` and thread name:
998
999 `http://localhost:19999/api/v1/function?function=ebpf_thread%20thread:mount`
1000
1001 #### Enable thread
1002
1003 It is possible to enable a specific thread using the keyword `enable`:
1004
1005 `http://localhost:19999/api/v1/function?function=ebpf_thread%20enable:mount`
1006
1007 this will run thread `mount` during 300 seconds (5 minutes). You can specify a specific period by appending the period
1008 after the thread name:
1009
1010 `http://localhost:19999/api/v1/function?function=ebpf_thread%20enable:mount:600`
1011
1012 in this example thread `mount` will run during 600 seconds (10 minutes).
1013
1014 #### Disable thread
1015
1016 It is also possible to stop any thread running using the keyword `disable`. For example, to disable `cachestat` you can
1017 request:
1018
1019 `http://localhost:19999/api/v1/function?function=ebpf_thread%20disable:cachestat`
1020
1021 #### Debugging threads
1022
1023 You can verify the impact of threads on the host by running the
1024 [ebpf_thread_function.sh](https://github.com/netdata/netdata/blob/master/tests/ebpf/ebpf_thread_function.sh)
1025 script on your environment.
1026
1027 You can check the results of having threads running on your environment in the Netdata monitoring section on your
1028 dashboard
1029
1030 <img src="https://github.com/netdata/netdata/assets/49162938/91823573-114c-4c16-b634-cc46f7bb1bcf" alt="Threads running." />
1031
1032 ### ebpf_socket
1033
1034 The eBPF plugin has a [function](/docs/top-monitoring-netdata-functions.md) named
1035 `ebpf_socket` that shows the current status of open sockets on host.
1036
1037 #### Families
1038
1039 The plugin shows by default sockets for IPV4 and IPV6, but it is possible to select a specific family by passing the
1040 family as an argument:
1041
1042 `http://localhost:19999/api/v1/function?function=ebpf_socket%20family:IPV4`
1043
1044 #### Resolve
1045
1046 The plugin resolves ports to service names by default. You can show the port number by disabling the name resolution:
1047
1048 `http://localhost:19999/api/v1/function?function=ebpf_socket%20resolve:NO`
1049
1050 #### CIDR
1051
1052 The plugin shows connections for all possible destination IPs by default. You can limit the range by specifying the CIDR:
1053
1054 `http://localhost:19999/api/v1/function?function=ebpf_socket%20cidr:192.168.1.0/24`
1055
1056 #### PORT
1057
1058 The plugin shows connections for all possible ports by default. You can limit the range by specifying a port or range
1059 of ports:
1060
1061 `http://localhost:19999/api/v1/function?function=ebpf_socket%20port:1-1024`