summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Arlt <reinhard.arlt@t-online.de>2015-05-08 11:03:45 +0200
committerReinhard Arlt <reinhard.arlt@t-online.de>2015-05-08 11:03:45 +0200
commit66df508ef49a6b899f751ead2a3b9cc8d8125d17 (patch)
tree362b6f5e85428c377b0e9b6115f6f2e0127f5829
parent1b5f56735b56a0d26d1e53d9f09d63b7591c2f73 (diff)
parent768cc659c6dd482fa893c836333f47b314b1ee4c (diff)
downloadgpsd-66df508ef49a6b899f751ead2a3b9cc8d8125d17.tar.gz
Merge branch 'master' of git://git.sv.gnu.org/gpsd
-rw-r--r--SConstruct8
-rwxr-xr-xleapsecond.py18
-rw-r--r--ntpshm.h2
-rw-r--r--ntpshmmon.c2
-rw-r--r--ntpshmmon.xml1
5 files changed, 20 insertions, 11 deletions
diff --git a/SConstruct b/SConstruct
index b3693890..74fb3d20 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1646,6 +1646,11 @@ else:
'$SRCDIR/test_json'
])
+# Unit-test timespec math
+timespec_regress = Utility('timespec-regress', [test_timespec], [
+ '$SRCDIR/test_timespec'
+ ])
+
# consistency-check the driver methods
method_regress = Utility('packet-regress', [test_packet], [
'@echo "Consistency-checking driver methods..."',
@@ -1666,7 +1671,7 @@ flocktest = Utility("flocktest", [], "cd devtools; ./flocktest " + gitrepo)
describe = Utility('describe', [],
['@echo "Run normal regression tests for %s..."' %(rev.strip(),)])
testclean = Utility('testclean', [],
- 'rm -f test_bits test_geoid test_json test_libgps test_matrix test_mktime test_packet test_timespec')
+ 'rm -f test_bits test_geoid test_json test_libgps test_matrix test_mktime test_packet')
check = env.Alias('check', [
describe,
python_compilation_regress,
@@ -1684,6 +1689,7 @@ check = env.Alias('check', [
json_regress,
testclean,
test_timespec,
+ timespec_regress,
])
env.Alias('testregress', check)
diff --git a/leapsecond.py b/leapsecond.py
index f2875101..c7d0b75f 100755
--- a/leapsecond.py
+++ b/leapsecond.py
@@ -24,7 +24,7 @@ Options:
-v be verbose
- -g generate a plot of the leap-second trend over time. The command you
+ -g generate a plot of leap-second dates over time. The command you
probably want is something like (depending on if your gnuplot install
does or does not support X11.
@@ -297,20 +297,22 @@ def graph_history(filename):
(b, c, e) = leastsquares(zip(range(len(raw)), raw))
e /= (60 * 60 * 24 * 7)
dates = map(lambda t: time.strftime("%Y-%m-%d", time.localtime(t)), raw)
+ enddate = time.strftime("%Y-%m-%d", time.localtime(raw[-1]+16416000)) # Adding 190 days to scale
fmt = ''
fmt += '# Least-squares approximation of Unix time from leapsecond is:\n'
fmt += 'lsq(x) = %s * x + %s\n' % (b, c)
fmt += '# Maximum residual error is %.2f weeks\n' % e
fmt += 'set autoscale\n'
- fmt += 'set xlabel "Leap second offset"\n'
- fmt += 'set xrange [0:%d]\n' % (len(dates) - 1)
- fmt += 'set ylabel "Leap second date"\n'
+ fmt += 'set ylabel "GPS-UTC (s)"\n'
+ fmt += 'set yrange [-1:%d]\n' % (len(dates))
+ fmt += 'set xlabel "Leap second date"\n'
+ fmt += 'set xtics rotate by 300\n'
fmt += 'set timefmt "%Y-%m-%d"\n'
- fmt += 'set ydata time\n'
- fmt += 'set format y "%Y-%m-%d"\n'
- fmt += 'set yrange ["%s":"%s"]\n' % (dates[0], dates[-1])
+ fmt += 'set xdata time\n'
+ fmt += 'set format x "%Y-%m-%d"\n'
+ fmt += 'set xrange ["%s":"%s"]\n' % ("1979-09-01", enddate)
fmt += 'set key left top box\n'
- fmt += 'plot "-" using 1:3 title "Leap-second trend" with linespoints ;\n'
+ fmt += 'plot "-" using 3:1 title "Leap second inserted" with points ;\n'
for (i, (r, d)) in enumerate(zip(raw, dates)):
fmt += "%d\t%s\t%s\n" % (i, r, d)
fmt += 'e\n'
diff --git a/ntpshm.h b/ntpshm.h
index 2811a4b4..02920401 100644
--- a/ntpshm.h
+++ b/ntpshm.h
@@ -25,7 +25,7 @@
* -1 is about 100mSec jitter
* -10 is about 1 mSec jitter (GR-601W or other USB with 1ms poll interval)
* -13 is about 100 uSec
- * -20 is about 1 nSec (typical for serial PPS)
+ * -20 is about 1 uSec (typical for serial PPS)
*/
struct shmTime
diff --git a/ntpshmmon.c b/ntpshmmon.c
index ebf48a01..c2a621c9 100644
--- a/ntpshmmon.c
+++ b/ntpshmmon.c
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
}
(void)printf("ntpshmmon version 1\n");
- (void)printf(" Name Seen@ Clock Real L Prec\n");
+ (void)printf("# Name Seen@ Clock Real L Prec\n");
do {
struct shm_stat_t shm_stat;
diff --git a/ntpshmmon.xml b/ntpshmmon.xml
index 71ceafaf..82e1bd0c 100644
--- a/ntpshmmon.xml
+++ b/ntpshmmon.xml
@@ -50,6 +50,7 @@ fields.</para>
<literallayout>
ntpshmmon version 1
+# Name Seen@ Clock Real L Prec
sample NTP2 1424926256.443030206 1424926256.115869233 1424926256.000000000 0 -1
sample NTP3 1424926256.443060517 1424926255.995430821 1424926256.000000000 0 -20
sample NTP3 1424926256.995747347 1424926256.995422728 1424926257.000000000 0 -20