summaryrefslogtreecommitdiff
path: root/gpsprof
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 /gpsprof
parent02a8d5b006544a57a96e8282cdff7091ad596007 (diff)
downloadgpsd-4d35b37c1f906265221363e6ba6b879cad9ab32b.tar.gz
Add decode time to the profiling.
Diffstat (limited to 'gpsprof')
-rwxr-xr-xgpsprof12
1 files changed, 7 insertions, 5 deletions
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)