gpsprof.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!--
  3. This file is Copyright 2010 by the GPSD project
  4. SPDX-License-Identifier: BSD-2-clause
  5. -->
  6. <!DOCTYPE refentry PUBLIC
  7. "-//OASIS//DTD DocBook XML V4.1.2//EN"
  8. "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
  9. <refentry id='gpsprof.1'>
  10. <refentryinfo><date>30 March 2020</date></refentryinfo>
  11. <refmeta>
  12. <refentrytitle>gpsprof</refentrytitle>
  13. <manvolnum>1</manvolnum>
  14. <refmiscinfo class="source">The GPSD Project</refmiscinfo>
  15. <refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
  16. </refmeta>
  17. <refnamediv id='name'>
  18. <refname>gpsprof</refname>
  19. <refpurpose>profile a GPS and gpsd, plotting latency information</refpurpose>
  20. </refnamediv>
  21. <refsynopsisdiv id='synopsis'>
  22. <cmdsynopsis>
  23. <command>gpsprof</command>
  24. <arg choice='opt'>-D <replaceable>debuglevel</replaceable></arg>
  25. <arg choice='opt'>-d <replaceable>dumpfile</replaceable></arg>
  26. <arg choice='opt'>-f <replaceable>plot_type</replaceable></arg>
  27. <arg choice='opt'>-h </arg>
  28. <arg choice='opt'>-l <replaceable>logfile</replaceable></arg>
  29. <arg choice='opt'>-m <replaceable>threshold</replaceable></arg>
  30. <arg choice='opt'>-n <replaceable>samplecount</replaceable></arg>
  31. <arg choice='opt'>-r </arg>
  32. <arg choice='opt'>-S <replaceable>subtitle</replaceable></arg>
  33. <arg choice='opt'>-T <replaceable>terminal</replaceable></arg>
  34. <arg choice='opt'>-t <replaceable>title</replaceable></arg>
  35. <arg choice='opt'>[server[:port[:device]]]</arg>
  36. </cmdsynopsis>
  37. </refsynopsisdiv>
  38. <refsect1 id='description'><title>DESCRIPTION</title>
  39. <para><application>gpsprof</application> performs accuracy, latency,
  40. skyview, and time drift profiling on a GPS. It emits to standard output
  41. a GNUPLOT program that draws one of several illustrative graphs. It can
  42. also be told to emit the raw profile data.</para>
  43. <para>Information from the default spatial plot it provides can be
  44. useful for characterizing position accuracy of a GPS.</para>
  45. <para><application>gpsprof</application> uses instrumentation built
  46. into <application>gpsd</application>. It can read data from a local
  47. or remote running <application>gpsd</application>. Or it can read
  48. data from a saved logfile.</para>
  49. <para><application>gpsprof</application> is designed to be lightweight
  50. and use minimal host resources. No graphics subsystem needs to be
  51. installed on the host running <application>gpsprof</application>. Simply
  52. copy the resultant plot file to another host to be rendered
  53. with <application>gnuplot</application>.
  54. </para>
  55. </refsect1>
  56. <refsect1 id='options'><title>OPTIONS</title>
  57. <para>The -f option sets the plot type. Currently the following plot
  58. types are defined:</para>
  59. <variablelist>
  60. <varlistentry>
  61. <term>space</term>
  62. <listitem>
  63. <para>Generate a scatterplot of fixes and plot probable error circles.
  64. This data is only meaningful if the GPS is held stationary while
  65. <application>gpsprof</application> is running. Various statistics about
  66. the fixes are listed at the bottom. This is the default plot type.</para>
  67. </listitem>
  68. </varlistentry>
  69. <varlistentry>
  70. <term>polar</term>
  71. <listitem>
  72. <para>Generate a heat map of reported satellite Signal to Noise Ratio
  73. (SNR) using polar coordinates. A colored dot is plotted for
  74. each satellite seen by the GPS. The color of dot corresponds to the
  75. SNR of the satellite. The dots are plotted by azimuth and
  76. elevation. North, azimuth 0 degrees, is at the top of the plot.
  77. Directly overhead, elevation of 90 degrees, is plotted at the center.
  78. Useful for analyzing the quality of the skyview as seen by the GPS.
  79. </para>
  80. </listitem>
  81. </varlistentry>
  82. <varlistentry>
  83. <term>polarunused</term>
  84. <listitem>
  85. <para>Similar to the polar plot, but only unused satellites
  86. are plotted. Useful for seeing which parts of the antenna skyview
  87. are obstructed, degraded, below the GPS elevation mask, or otherwise
  88. rejected.</para>
  89. </listitem>
  90. </varlistentry>
  91. <varlistentry>
  92. <term>polarused</term>
  93. <listitem>
  94. <para>Similar to the polar plot, but only satellites used to compute
  95. fixes are plotted. Useful for seeing which parts of the antenna
  96. skyview are being used in fixes.</para>
  97. </listitem>
  98. </varlistentry>
  99. <varlistentry>
  100. <term>time</term>
  101. <listitem>
  102. <para>Plot delta of system clock (NTP corrected time) against GPS time
  103. as reported in PPS messages. The X axis is sample time in seconds
  104. from the start of the plot. The Y axis is the system clock delta from
  105. GPS time.</para>
  106. </listitem>
  107. </varlistentry>
  108. <varlistentry>
  109. <term>instrumented</term>
  110. <listitem>
  111. <para>Plot instrumented profile. Plots various components of the total
  112. latency between the GPS's fix time and when the client receives the
  113. fix.</para>
  114. <para>For purposes of the description, below, start-of-reporting-cycle
  115. (SORC) is when a device's reporting cycle begins. This time is
  116. detected by watching to see when data availability follows a long
  117. enough amount of quiet time that we can be sure we've seen the gap at
  118. the end of the sensor's previous report-transmission cycle. Detecting
  119. this gap requires a device running at 9600bps or faster.</para>
  120. <para>Similarly, EORC is end-of-reporting-cycle; when the daemon has
  121. seen the last sentence it needs in the reporting cycle and ready to ship
  122. a fix to the client.</para>
  123. <para>The components of the instrumented plot are as follows:</para>
  124. <variablelist>
  125. <varlistentry>
  126. <term>Fix latency</term>
  127. <listitem>
  128. <para>Delta between GPS time and SORC.</para>
  129. </listitem>
  130. </varlistentry>
  131. <varlistentry>
  132. <term>RS232 time</term>
  133. <listitem>
  134. <para>RS232 transmission time for data shipped during the cycle
  135. (computed from character volume and baud rate).</para>
  136. </listitem>
  137. </varlistentry>
  138. <varlistentry>
  139. <term>Analysis time</term>
  140. <listitem>
  141. <para>EORC, minus SORC, minus RS232 time. The amount of real time the daemon
  142. spent on computation rather than I/O.</para>
  143. </listitem>
  144. </varlistentry>
  145. <varlistentry>
  146. <term>Reception time</term>
  147. <listitem>
  148. <para>Shipping time from
  149. the daemon to when it was received by <application>gpsprof</application>.</para>
  150. </listitem>
  151. </varlistentry>
  152. </variablelist>
  153. <para>Because of RS232 buffering effects, the profiler sometimes
  154. generates reports of ridiculously high latencies right at the
  155. beginning of a session. The -m option lets you set a latency
  156. threshold, in multiples of the cycle time, above which reports are
  157. discarded.</para>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry>
  161. <term>uninstrumented</term>
  162. <listitem>
  163. <para>Plot total latency without instrumentation. Useful mainly as a
  164. check that the instrumentation is not producing significant distortion.
  165. The X axis is sample time in seconds from the start of the plot. The Y
  166. axis is latency in seconds. It only plots times for reports that contain
  167. fixes; staircase-like artifacts in the plot are created when elapsed
  168. time from reports without fixes is lumped in.</para>
  169. </listitem>
  170. </varlistentry>
  171. </variablelist>
  172. <para>The -d option dumps the plot data, without attached gnuplot
  173. code, to a specified file for post-analysis.</para>
  174. <para>The -D sets debug level.</para>
  175. <para>The -h option makes <application>gpsprof</application> print
  176. a usage message and exit.</para>
  177. <para>The -l option dumps the raw JSON reports collected from the device
  178. to a specified file.</para>
  179. <para>The -n option sets the number of packets to sample. The default
  180. is 100. Most GPS are configured to emit one fix per second, so 100
  181. samples would then span 100 seconds.</para>
  182. <para>The -r option replots from a JSON logfile (such as -l produces)
  183. on standard input. Both -n and -l options are ignored when this
  184. one is selected.</para>
  185. <para>The -S option sets a text string to be included in the plot
  186. as a subtitle. This will be below the title.</para>
  187. <para>The -t option sets a text string to be the plot title. This
  188. will replace the default title.</para>
  189. <para>The -T option generates a terminal type setting into the gnuplot
  190. code. Typical usage is "-T png", or "-T pngcairo" telling gnuplot to
  191. write a PNG file. Without this option gnuplot will call its X11 display
  192. code.</para>
  193. <para> Different installations of <application>gnuplot</application> will
  194. support different terminal types. Different terminal types may work better
  195. for you than other ones. "-T png" will generate PNG images. Use "-T jpeg"
  196. to generate JPEG images. "-T pngcairo" often works best, but is not
  197. supported by some distributions.</para>
  198. </refsect1>
  199. <refsect1 id='signals'><title>SIGNALS</title>
  200. <para>Sending SIGUSR1 to a running instance causes it to write a
  201. completion message to standard error and resume processing. The
  202. first number in the startup message is the process ID to signal.</para>
  203. </refsect1>
  204. <refsect1 id='examples'><title>EXAMPLES</title>
  205. <para>To display the graph, use
  206. <citerefentry><refentrytitle>gnuplot</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
  207. Thus, for example, to display the default spatial scatter plot, do
  208. this:
  209. <programlisting>
  210. gpsprof | gnuplot -persist
  211. </programlisting>
  212. </para>
  213. <para>To generate an image file:
  214. <programlisting>
  215. gpsprof -T png | gnuplot &gt; image.png
  216. </programlisting>
  217. </para>
  218. <para>
  219. To generate a polar plot, and save the GPS data for further plots:
  220. <programlisting>
  221. gpsprof -f polar -T jpeg -l polar.json | gnuplot &gt; polar.png
  222. </programlisting>
  223. Then to make the matching polarused and polarunused plots and pngs from
  224. the just saved the GPS data:
  225. <programlisting>
  226. gpsprof -f polarused -T jpeg -r &lt; polar.json &gt; polarused.plot
  227. gnuplot &lt; polarused.plot &gt; polarused.png
  228. gpsprof -f polarunused -T jpeg -r &lt; polar.json &gt; polarunused.plot
  229. gnuplot &lt; polarunused.plot &gt; polarunused.png
  230. </programlisting>
  231. </para>
  232. </refsect1>
  233. <refsect1 id='see_also'><title>SEE ALSO</title>
  234. <para>
  235. <citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
  236. <citerefentry><refentrytitle>gps</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
  237. <citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
  238. <citerefentry><refentrytitle>libgpsmm</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
  239. <citerefentry><refentrytitle>gpsfake</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
  240. <citerefentry><refentrytitle>gpsctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
  241. <citerefentry><refentrytitle>gpscat</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
  242. <citerefentry><refentrytitle>gnuplot</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
  243. </para>
  244. </refsect1>
  245. <refsect1 id='maintainer'><title>AUTHOR</title>
  246. <para>Eric S. Raymond <email>esr@thyrsus.com</email>.</para>
  247. </refsect1>
  248. </refentry>