Applies to Debian-based distros too.
sudo apt install linux-source build-essential
cd /usr/src ; sudo tar -xf linux-source-5.10.tar.xz
cd /usr/src/linux-source-5.10/tools/testing/selftests/ptp ; gcc -static testptp.c -o testptp
mv testptp /usr/bin/.
$ sudo testptp /dev/ptp0 -c capabilities: 62499999 maximum frequency adjustment (ppb) 0 programmable alarms 2 external time stamp channels 2 programmable periodic signals 1 pulse per second 4 programmable pins 0 cross timestamping 0 adjust_phase