summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-09-21 16:19:23 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-09-21 16:19:23 -0400
commit4d35b37c1f906265221363e6ba6b879cad9ab32b (patch)
tree7a92cd39b585079c6c7e256c667e206efc2f48b8
parent02a8d5b006544a57a96e8282cdff7091ad596007 (diff)
downloadgpsd-4d35b37c1f906265221363e6ba6b879cad9ab32b.tar.gz
Add decode time to the profiling.
-rw-r--r--gpsd_json.c4
-rwxr-xr-xgpsprof12
-rw-r--r--libgpsd_core.c5
3 files changed, 14 insertions, 7 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index 41d71164..e694a431 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -214,8 +214,8 @@ void json_tpv_dump(const struct gps_data_t *gpsdata,
if (policy->timing)
(void)snprintf(reply + strlen(reply),
replylen - strlen(reply),
- "\"xmit_time\":%f,",
- xmit_time);
+ "\"cycle_start\":%f,\"xmit_time\":%f,",
+ gpsdata->cycle_start, xmit_time);
#endif /* TIMING_ENABLE */
}
if (reply[strlen(reply) - 1] == ',')
diff --git a/gpsprof b/gpsprof
index 72993b5e..85aedae7 100755
--- a/gpsprof
+++ b/gpsprof
@@ -193,6 +193,7 @@ class rawplot:
if 'xmit_time' in session.data:
self.stats.append((session.data['tag'],
gps.misc.isotime(session.data['time']),
+ session.data['cycle_start'],
session.data['xmit_time'],
time.time()))
return True
@@ -204,8 +205,8 @@ class rawplot:
return res + "\n"
def data(self, unused):
res = ""
- for (tag, time, xmit, recv) in self.stats:
- res += "% 8s %2.9f %2.9f %2.9f\n" % (tag, time, xmit-time, recv-xmit)
+ for (tag, time, start, xmit, recv) in self.stats:
+ res += "% 8s %2.9f %2.9f %2.9f %2.9f\n" % (tag, time, start-time, xmit-start, recv-xmit)
return res
def plot(self, unused, session, device):
fmt = '''
@@ -213,14 +214,15 @@ set autoscale
set key below
set key title "Raw latency data, %s, %s, %dN%d, cycle %ds"
plot \
- "-" using 0:4 title "Reception delta" with impulses, \
- "-" using 0:3 title "Transmission delta" with impulses
+ "-" using 0:5 title "Reception delta" with impulses, \
+ "-" using 0:4 title "Transmission delta" with impulses, \
+ "-" using 0:3 title "Decode time" with impulses
'''
res = fmt % (title,
device['driver'], device['bps'],
device['stopbits'], device['cycle'])
res += self.header(session, device)
- res += (self.data(session) + "e\n") * 2
+ res += (self.data(session) + "e\n") * 3
return res
formatters = (spaceplot, uninstrumented, rawplot)
diff --git a/libgpsd_core.c b/libgpsd_core.c
index e3ab7f3d..0994f632 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -843,6 +843,11 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
* will consistently be emitted just before the sentence that shows up
* as start-of-cycle in gpsmon, and never emitted at any other point
* in the cycle.
+ *
+ * In practice, it seems that edge detection succeeds at 9600bps but
+ * fails at 4800bps. This is not surprsing, as previous proviling has
+ * indicated that st 4800bps some devices overrun a 1-second cycle time
+ * with the data they transmit.
*/
#define MINIMUM_QUIET_TIME 0.25
if (session->packet.outbuflen == 0)