summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgpsprof13
-rw-r--r--gpsprof.xml12
2 files changed, 21 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
diff --git a/gpsprof.xml b/gpsprof.xml
index cf8eb493..c68b5d78 100644
--- a/gpsprof.xml
+++ b/gpsprof.xml
@@ -26,6 +26,7 @@ BSD terms apply: see the file COPYING in the distribution root for details.
<arg choice='opt'>-m <replaceable>threshold</replaceable></arg>
<arg choice='opt'>-n <replaceable>packetcount</replaceable></arg>
<arg choice='opt'>-t <replaceable>title</replaceable></arg>
+ <arg choice='opt'>-T <replaceable>terminal</replaceable></arg>
<arg choice='opt'>-d</arg>
<arg choice='opt'>-D <replaceable>debuglevel</replaceable></arg>
<arg choice='opt'>-h</arg>
@@ -54,6 +55,13 @@ gpsprof | gnuplot -persist
</programlisting>
</para>
+<para>To generate an image file:
+
+<programlisting>
+gpsprof -T png | gnuplot >image.png
+</programlisting>
+</para>
+
</refsect1>
<refsect1 id='options'><title>OPTIONS</title>
@@ -146,6 +154,10 @@ is 100.</para>
<para>The -t option sets a text string to be included in the plot
title.</para>
+<para>The -T option generates a terminal type setting into the gnuplot code.
+Typical usage is "-T png" telling gnuplot to write a PNG file. Without
+this option gnuplot will call its X11 display code.</para>
+
<para>The -d option suppresses plot generation, dumping the plot data instead.
This option is a no-op with the space plot.</para>