[LinuxPPS] Profiling the latency of the testptp program

First Last ssrspam1 at gmail.com
Wed Sep 6 19:29:38 CEST 2023


Hi there,

I am trying to profile the latency of the testptp.c self-test in the linux
kernel (linux/tools/testing/selftests/ptp/testptp.c). (This will become
more clear later on)

I have compiled it separately, and am using the following commands to
enable PPS on my Intel I210 NICs:

./testptp -d /dev/ptp0 -L 0,2
./testptp -d /dev/ptp0 -p 1000000000

Using an oscilloscope, I can see the PPS signal being asserted on my NIC at
1PPS, and I can see the "assert" timestamp by using:

cat /sys/class/pps/pps0/assert

It's not clear to me what timestamp is showing under the assert file. I'm
assuming that an interrupt is generated after a certain amount of clock
ticks assert the PPS signal on the pin. Presumably, there is a latency
between when the interrupt is generated, and when the PPS pin is actually
asserted. I understand this latency will be very small, but I'd still like
to profile it. Is the timestamp in "assert" the time that the IRQ was
generated, or the time that the PPS pin was actually asserted?

I was going to use cyclictest to profile the latency between the call for
PPS to be asserted, and when it's actually asserted, but I don't think I
can do that since there isn't a process that actively does this. Any ideas?

Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.linuxpps.org/pipermail/discussions/attachments/20230906/702345cc/attachment.html>


More information about the discussions mailing list