Choose a probe set
Theprobes setting selects the set:
Set it in the configuration file or on the agent’s command line:
filetrace doctor loads and attaches every probe of a set, reports which set is in use and what the kernel accepted, and removes the probes again. filetrace without arguments shows the set the running agent uses, for example Linux eBPF (trampolines), standard mode.
Trampoline set
The probes see the kernel’s own file and socket objects, so nothing is keyed on file descriptor numbers, and descriptor reuse cannot misattribute a transfer.
Kprobe set
The trampoline set needs the return value of each traced function. Where the kernel cannot attach trampolines, the usual substitute is a return probe (kretprobe), and it does not hold up for this workload: a return probe keeps one of a small pool of instances for as long as the call blocks, as many as there are CPUs on a kernel without full preemption. A few threads waiting inrecv are enough for every other return to go unseen.
The kprobe set therefore probes function entries only and reads the results from counters the kernel keeps anyway:
Sequence numbers cannot miss a call: whatever was sent since the socket was last looked at is the difference.
Differences of the kprobe set
- The bytes of the last send on a connection are counted when the socket is next used or closed.
- Kernel TLS sockets count encrypted bytes.
- Raw and ICMP sockets are not counted.
- File reads need a kernel built with
CONFIG_TASK_XACCT. - What a thread reads with
readvbetween a file read and a send is counted as read from that file. - The kernel holds about 8 MB more in BPF maps for the kprobe set’s socket table.