summaryrefslogtreecommitdiff
path: root/gpsprof
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-09-23 14:04:19 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-09-23 14:04:19 -0400
commit66500ec3a22c7f85a061e40d4a9f9bd97e71762b (patch)
treed015ec0a0c9c810063167d10de8f4d71324b2d5e /gpsprof
parent2436d783d1f0c31d8782b6297a1e43f377457ba6 (diff)
downloadgpsd-66500ec3a22c7f85a061e40d4a9f9bd97e71762b.tar.gz
Restore gpsprof's -T option.
Diffstat (limited to 'gpsprof')
-rwxr-xr-xgpsprof13
1 files changed, 9 insertions, 4 deletions
diff --git a/gpsprof b/gpsprof
index ab53f744..a3c4cabf 100755
--- a/gpsprof
+++ b/gpsprof
@@ -174,7 +174,7 @@ class uninstrumented:
def plot(self, title, session, device, dump):
res = ""
if not dump:
- fmt = '''
+ fmt = '''\
set autoscale
set key below
set key title "Uninstrumented total latency, %s, %s, %dN%d, cycle %ds"
@@ -223,7 +223,7 @@ class instrumented:
"RS232 time",
"Fix latency",
)
- fmt = '''
+ fmt = '''\
set autoscale
set key below
set key title "Raw latency data, %s, %s, %dN%d, cycle %ds"
@@ -308,7 +308,7 @@ def plotframe(await, fname, threshold, title, dump):
if __name__ == '__main__':
try:
- (options, arguments) = getopt.getopt(sys.argv[1:], "df:hm:n:s:t:D:")
+ (options, arguments) = getopt.getopt(sys.argv[1:], "df:hm:n:s:t:T:D:")
formatter = "space"
raw = False
@@ -316,6 +316,7 @@ if __name__ == '__main__':
threshold = 0
await = 100
verbose = 0
+ terminal = None
dump = False
for (switch, val) in options:
if (switch == '-f'):
@@ -326,6 +327,8 @@ if __name__ == '__main__':
await = int(val)
elif (switch == '-t'):
title = val
+ elif (switch == '-T'):
+ terminal = val
elif (switch == '-d'):
dump = True
elif (switch == '-D'):
@@ -333,8 +336,10 @@ if __name__ == '__main__':
elif (switch == '-h'):
sys.stderr.write(\
"usage: gpsprof [-h] [-D debuglevel] [-m threshold] [-n samplecount] [-d]\n"
- + "\t[-f {" + "|".join(map(lambda x: x.name, formatters)) + "}] [-s speed] [-t title]\n")
+ + "\t[-f {" + "|".join(map(lambda x: x.name, formatters)) + "}] [-s speed] [-t title] [-T terminal]\n")
sys.exit(0)
+ if terminal:
+ sys.stdout.write("set terminal %s\n" % terminal)
sys.stdout.write(plotframe(await,formatter,threshold,title,dump))
except KeyboardInterrupt:
pass