Open jclark opened 2 years ago
Questions here:
We can bpftrace and see whether the bad pulse happens at the same time as explicitly requesting a timestamp.
Here's another one:
Nov 16 12:39:14 wensleydale ts2phc: [349041.521] eth0 extts index 0 at 1668577190.999999988 corr 0 src 1668577191.18746814 diff -12
Nov 16 12:39:14 wensleydale ts2phc: [349041.521] eth0 master offset -12 s2 freq +13717
Nov 16 12:39:15 wensleydale ts2phc: [349042.501] nmea sentence: GPRMC,053915.00,A,1343.91052,N,10038.68416,E,0.000,,161122,,,A,V
Nov 16 12:39:15 wensleydale ts2phc: [349042.528] nmea delay: 148205941 ns
Nov 16 12:39:15 wensleydale ts2phc: [349042.529] eth0 extts index 0 at 1668577191.999999996 corr 0 src 1668577192.27544879 diff -4
Nov 16 12:39:15 wensleydale ts2phc: [349042.529] eth0 master offset -4 s2 freq +13721
Nov 16 12:39:16 wensleydale ts2phc: [349043.500] nmea sentence: GPRMC,053916.00,A,1343.91052,N,10038.68416,E,0.000,,161122,,,A,V
Nov 16 12:39:16 wensleydale ts2phc: [349043.536] nmea delay: 146878696 ns
Nov 16 12:39:16 wensleydale ts2phc: [349043.537] eth0 extts index 0 at 1668577192.999999980 corr 0 src 1668577193.36885194 diff -20
Nov 16 12:39:16 wensleydale ts2phc: [349043.537] eth0 master offset -20 s2 freq +13704
Nov 16 12:39:16 wensleydale ts2phc: [349044.292] nmea delay: 146878696 ns
This pulse is bad. It's an extra one. Previous one is roughly 1668577193. Next one is roughly 1668577194. This one is roughly 1668577193.75.
Nov 16 12:39:16 wensleydale ts2phc: [349044.293] eth0 extts index 0 at 1668577193.752813037 corr 0 src 1668577194.792838697 diff -247186963
Nov 16 12:39:16 wensleydale ts2phc: [349044.293] eth0 master offset -247186963 s2 freq -100000000
Nov 16 12:39:17 wensleydale ts2phc: [349044.501] nmea sentence: GPRMC,053917.00,A,1343.91052,N,10038.68416,E,0.000,,161122,,,A,V
Nov 16 12:39:17 wensleydale ts2phc: [349044.544] nmea delay: 148458442 ns
Nov 16 12:39:17 wensleydale ts2phc: [349044.545] eth0 extts index 0 at 1668577194.005987505 corr 0 src 1668577194.43304278 diff 5987505
Nov 16 12:39:17 wensleydale ts2phc: [349044.545] eth0 master offset 5987505 s2 freq +6001223
Nov 16 12:39:18 wensleydale ts2phc: [349045.500] nmea sentence: GPRMC,053918.00,A,1343.91052,N,10038.68416,E,0.000,,161122,,,A,V
Nov 16 12:39:18 wensleydale ts2phc: [349045.552] nmea delay: 147272812 ns
Nov 16 12:39:18 wensleydale ts2phc: [349045.553] eth0 extts index 0 at 1668577195.020366422 corr 0 src 1668577195.52504131 diff 20366422
Nov 16 12:39:18 wensleydale ts2phc: [349045.553] eth0 master offset 20366422 s2 freq +22176391
Nov 16 12:39:19 wensleydale ts2phc: [349046.500] nmea sentence: GPRMC,053919.00,A,1343.91052,N,10038.68416,E,0.000,,161122,,,A,V
Nov 16 12:39:19 wensleydale ts2phc: [349046.560] nmea delay: 147516834 ns
Nov 16 12:39:19 wensleydale ts2phc: [349046.561] eth0 extts index 0 at 1668577196.001441159 corr 0 src 1668577196.60270471 diff 1441159
Nov 16 12:39:19 wensleydale ts2phc: [349046.561] eth0 master offset 1441159 s2 freq +9361055
Nov 16 12:39:20 wensleydale ts2phc: [349047.501] nmea sentence: GPRMC,053920.00,A,1343.91052,N,10038.68416,E,0.000,,161122,,,A,V
Nov 16 12:39:20 wensleydale ts2phc: [349047.568] nmea delay: 148233424 ns
Nov 16 12:39:20 wensleydale ts2phc: [349047.569] eth0 extts index 0 at 1668577196.989426097 corr 0 src 1668577197.67511875 diff -10573903
Nov 16 12:39:20 wensleydale ts2phc: [349047.569] eth0 master offset -10573903 s2 freq -2221659
Nov 16 12:39:21 wensleydale ts2phc: [349048.500] nmea sentence: GPRMC,053921.00,A,1343.91052,N,10038.68416,E,0.000,,161122,,,A,V
Nov 16 12:39:21 wensleydale ts2phc: [349048.576] nmea delay: 147325390 ns
Nov 16 12:39:21 wensleydale ts2phc: [349048.577] eth0 extts index 0 at 1668577197.989158247 corr 0 src 1668577198.76451844 diff -10841753
Nov 16 12:39:21 wensleydale ts2phc: [349048.577] eth0 master offset -10841753 s2 freq -5661680
Nov 16 12:39:22 wensleydale ts2phc: [349049.501] nmea sentence: GPRMC,053922.00,A,1343.91052,N,10038.68416,E,0.000,,161122,,,A,V
Nov 16 12:39:23 wensleydale ts2phc: [349050.500] nmea sentence: GPRMC,053923.00,A,1343.91052,N,10038.68416,E,0.000,,161122,,,A,V
Nov 16 12:39:23 wensleydale ts2phc: [349050.579] poll returns zero, no events
Nov 16 12:39:23 wensleydale ts2phc: [349050.592] nmea delay: 147205838 ns
Nov 16 12:39:23 wensleydale ts2phc: [349050.592] eth0 extts index 0 at 1668577199.999738067 corr 0 src 1668577200.92387277 diff -261933
Nov 16 12:39:23 wensleydale ts2phc: [349050.592] eth0 master offset -261933 s2 freq +1665614
Relevant entries from bpftrace on ptp_clock_event:
ptp_clock_event sys=349029424702674, phc=1668577179000000000
ptp_clock_event sys=349030432693033, phc=1668577180000000001
ptp_clock_event sys=349031440677301, phc=1668577181000000001
ptp_clock_event sys=349032448696752, phc=1668577181999999976
ptp_clock_event sys=349033456687149, phc=1668577183000000006
PTP_SYS_OFFSET_EXTENDED n_samples=10, sys=349033549559048, pid=545
ptp_clock_event sys=349034464703606, phc=1668577184000000002
ptp_clock_event sys=349035472667843, phc=1668577185000000014
ptp_clock_event sys=349036480688877, phc=1668577185999999983
ptp_clock_event sys=349037488682595, phc=1668577186999999997
ptp_clock_event sys=349038496688518, phc=1668577188000000015
ptp_clock_event sys=349039504696644, phc=1668577189000000001
ptp_clock_event sys=349040512759824, phc=1668577190000000009
ptp_clock_event sys=349041520703488, phc=1668577190999999988
ptp_clock_event sys=349042528693077, phc=1668577191999999996
ptp_clock_event sys=349043536697314, phc=1668577192999999980
ptp_clock_event sys=349044292671057, phc=1668577193752813037 # spurious
ptp_clock_event sys=349044544702626, phc=1668577194005987505
ptp_clock_event sys=349045552713830, phc=1668577195020366422
ptp_clock_event sys=349046560722063, phc=1668577196001441159
ptp_clock_event sys=349047568692370, phc=1668577196989426097
ptp_clock_event sys=349048576695085, phc=1668577197989158247
PTP_SYS_OFFSET_EXTENDED n_samples=10, sys=349049563136215, pid=545
ptp_clock_event sys=349050592698242, phc=1668577199999738067
ptp_clock_event sys=349051600720277, phc=1668577200999846246
ptp_clock_event sys=349052356684894, phc=1668577201998172099
This means the kernel is generating the extra pulse. The last PTP_SYS_OFFSET_EXTENDED is 11 seconds before, which I think means it's unlikely to be confusion between the two kinds of timestamp.
I am seeing occasional (e.g. once every several days) extra PPS pulses, which cause ts2phc to perform some extreme adjustments. Here's an example, which is with a u-blox M8T with an outside, but ground-level antenna (so less than perfect sky-view).
Here it reads two nmea sentences without an intervening pulse
This next pulse is is an extra, spurious pulse. I think
1668332362.43187178
is the PHC of the pulse. It's an extra one between the previous one, which is roughly 1668332362, and the next one, which is roughly 1668332363.