netdata / kernel-collector

Linux Kernel eBPF Collectors
61 stars 15 forks source link

Update socket to use latest functions #313

Closed thiagoftsm closed 2 years ago

thiagoftsm commented 2 years ago
Summary

This PR is bringing necessary changes in socket program allowing it to monitor PID better.

Test Plan
  1. Get binaries from this link and save inside a directory.
  2. Compile this branch: make clean; make
  3. Run the following tests:
    # for i in `seq 0 2`; do ./kernel/legacy_test --content --iteration 2 --socket --netdata-path directory --pid $i --log-path pid$i.txt ; sleep 1; done
Additional information

This PR was tested on:

Linux Distribution kernel version real parent parent all
Slackware Current 5.19.2 slackware_5_19_pid0.txt slackware_5_19_pid1.txt slackware_5_19_pid2.txt
Arch Linux 5.19.2-arch1-2 arch_5_19_pid0.txt arch_5_19_pid1.txt arch_5_19_pid2.txt
Ubuntu 22.04 5.15.0-33-generic ubuntu_5_15_pid0.txt ubuntu_5_15_pid1.txt ubuntu_5_15_pid2.txt
Alma 9 5.14.0-70.17.1.el9_0.x86_64 alma_5_14_pid0.txt alma_5_14_pid1.txt alma_5_14_pid2.txt
Debian 11 5.10.0-16-amd64 debian_5_10_pid0.txt debian_5_10_pid1.txt debian_5_10_pid2.txt
Alma 8.6 4.18.0-372.19.1.el8_6 alma_4_18_pid0.txt alma_4_18_pid1.txt alma_4_18_pid2.txt

I tested on ancient kernels, and I observed issues for kernels older than 4.16 that will be fixed with this https://github.com/netdata/kernel-collector/pull/314 .

underhood commented 2 years ago

no objections, i will approve after vlvkobal comment is resolved