gpsprof.adoc 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. = gpsprof(1)
  2. :author: Eric S. Raymond
  3. :date: 25 February 2021
  4. :email: <esr@thyrsus.com.>
  5. :keywords: gps, gpsd, gpsprof, gpspipe
  6. :manmanual: GPSD Documentation
  7. :mansource: GPSD, Version {gpsdver}
  8. :robots: index,follow
  9. :sectlinks:
  10. :toc: macro
  11. :type: manpage
  12. :webfonts!:
  13. include::../www/inc-menu.adoc[]
  14. == NAME
  15. gpsprof - profile a GPS and gpsd, plotting latency information
  16. == SYNOPSIS
  17. *gpsprof* [OPTIONS] [server[:port[:device]]]
  18. *gpsprof* -h
  19. *gpsprof* -V
  20. == DESCRIPTION
  21. *gpsprof* performs accuracy, latency, skyview, and time drift profiling on
  22. a GPS. It emits to standard output a GNUPLOT program that draws one of
  23. several illustrative graphs. It can also be told to emit the raw profile
  24. data.
  25. Information from the default spatial plot it provides can be useful for
  26. characterizing position accuracy of a GPS.
  27. *gpsprof* uses instrumentation built into gpsd. It can read data from a
  28. local or remote running gpsd. Or it can read data from a saved logfile.
  29. *gpsprof* is designed to be lightweight and use minimal host resources. No
  30. graphics subsystem needs to be installed on the host running *gpsprof*.
  31. Simply copy the resultant plot file to another host to be rendered with
  32. *gnuplot(1)*.
  33. *gpsprof* does not require root privileges, but it will run fine as root.
  34. == OPTIONS
  35. The *-f, --formatter* option sets the plot type. Currently the
  36. following plot types are defined:
  37. *space*::
  38. Generate a scatterplot of fixes and plot probable error circles. This
  39. data is only meaningful if the GPS is held stationary while *gpsprof* is
  40. running. Various statistics about the fixes are listed at the bottom.
  41. This is the default plot type.
  42. *polar*::
  43. Generate a heat map of reported satellite Signal to Noise Ratio (SNR)
  44. using polar coordinates. A colored dot is plotted for each satellite
  45. seen by the GPS. The color of dot corresponds to the SNR of the
  46. satellite. The dots are plotted by azimuth and elevation. North,
  47. azimuth 0 degrees, is at the top of the plot. Directly overhead,
  48. elevation of 90 degrees, is plotted at the center. Useful for
  49. analyzing the quality of the skyview as seen by the GPS.
  50. *polarunused*::
  51. Similar to the polar plot, but only unused satellites are plotted.
  52. Useful for seeing which parts of the antenna skyview are obstructed,
  53. degraded, below the GPS elevation mask, or otherwise rejected.
  54. *polarused*::
  55. Similar to the polar plot, but only satellites used to compute fixes
  56. are plotted. Useful for seeing which parts of the antenna skyview are
  57. being used in fixes.
  58. *time*::
  59. Plot delta of system clock (NTP corrected time) against GPS time as
  60. reported in PPS messages. The X axis is sample time in seconds from
  61. the start of the plot. The Y axis is the system clock delta from GPS
  62. time.
  63. *instrumented*::
  64. Plot instrumented profile. Plots various components of the total
  65. latency between the GPS's fix time and when the client receives the
  66. fix.
  67. For purposes of the description, below, start-of-reporting-cycle
  68. (SORC) is when a device's reporting cycle begins. This time is
  69. detected by watching to see when data availability follows a long
  70. enough amount of quiet time that we can be sure we've seen the gap at
  71. the end of the sensor's previous report-transmission cycle. Detecting
  72. this gap requires a device running at 9600bps or faster.
  73. Similarly, EORC is end-of-reporting-cycle; when the daemon has seen
  74. the last sentence it needs in the reporting cycle and ready to ship a
  75. fix to the client.
  76. The components of the instrumented plot are as follows:
  77. *Fix latency*;;
  78. Delta between GPS time and SORC.
  79. *RS232 time*;;
  80. RS232 transmission time for data shipped during the cycle (computed
  81. from character volume and baud rate).
  82. *Analysis time*;;
  83. EORC, minus SORC, minus RS232 time. The amount of real time the
  84. daemon spent on computation rather than I/O.
  85. *Reception time*;;
  86. Shipping time from the daemon to when it was received by *gpsprof*.
  87. Because of RS232 buffering effects, the profiler sometimes generates
  88. reports of ridiculously high latencies right at the beginning of a
  89. session. The -m option lets you set a latency threshold, in multiples
  90. of the cycle time, above which reports are discarded.
  91. *uninstrumented*::
  92. Plot total latency without instrumentation. Useful mainly as a check
  93. that the instrumentation is not producing significant distortion. The
  94. X axis is sample time in seconds from the start of the plot. The Y
  95. axis is latency in seconds. It only plots times for reports that
  96. contain fixes; staircase-like artifacts in the plot are created when
  97. elapsed time from reports without fixes is lumped in.
  98. *-?*, *-h*, *--help*::
  99. Print a usage message and exit.
  100. *-d FILE*, *--dumpfile FILE*::
  101. Dump the plot data, without attached *gnuplot(1)* code, to a specified file
  102. for post-analysis.
  103. *-d LVL*, *--debug LVL*::
  104. Sets debug level.
  105. *-l FILE*, *--logfile FILE*::
  106. Dump the raw JSON reports collected from the device to the specified
  107. FILE.
  108. *-n SEC*, *--wait SEC*::
  109. Sets the number of seconds to sample. The default is 100. Most GPS are
  110. configured to emit one fix per second, so 100 samples would then span
  111. 100 seconds.
  112. *-r*, *--redo*::
  113. Replot from a JSON logfile (such as *-l, logfile* produces) on
  114. standard input. Both *-n, --wait* and *-l, --logfile* options are
  115. ignored when this one is selected.
  116. *-S STR*, *--subtitle STR*::
  117. Sets a text string to be included in the plot as a subtitle. This will
  118. be below the title.
  119. *-t STR*, *--title STR*::
  120. Sets a text string to be the plot title. This will replace the default
  121. title.
  122. *-T TERM*, *--terminal TERM*::
  123. Specify the terminal type setting in the *gnuplot(1)* code. Typical usage is
  124. "*-T png*", or "*-T pngcairo*" telling *gnuplot(1)* to write a PNG file.
  125. The default terminal is "x11".
  126. +
  127. Different installations of *gnuplot(1)* will support different terminal
  128. types. Different terminal types may work better for you than other
  129. ones. "*-T png*" will generate PNG images. Use "*-T jpeg*" to
  130. generate JPEG images. "*-T pngcairo*" often works best, but is not
  131. supported by some distributions. The same terminal type may work very
  132. differently on different distributions.
  133. +
  134. To see which terminal types your copy of *gnuplot(1)* supports:
  135. ----
  136. gnuplot -e "set terminal"
  137. ----
  138. == ARGUMENTS
  139. By default, clients collect data from the local *gpsd* daemon running
  140. on localhost, using the default GPSD port 2947. The optional argument
  141. to any client may override this behavior: *[server[:port[:device]]]*
  142. For further explanation, and examples, see the *ARGUMENTS* section in
  143. the *gps*(1) man page
  144. == SIGNALS
  145. Sending SIGUSR1 to a running instance causes it to write a completion
  146. message to standard error and resume processing. The first number in the
  147. startup message is the process ID to signal.
  148. == EXAMPLES
  149. To display the graph, use *gnuplot(1)* . Thus, for example, to display the
  150. default spatial scatter plot on your x11 display, do this:
  151. ----
  152. gpsprof | gnuplot -persist
  153. ----
  154. To generate an image file:
  155. ----
  156. gpsprof -T png | gnuplot > image.png
  157. ----
  158. To generate a polar plot, and save the GPS data for further plots:
  159. ----
  160. gpsprof -f polar -T jpeg -l polar.json | gnuplot > polar.png
  161. ----
  162. Then to make the matching polarused and polarunused plots and pngs from
  163. the just saved the GPS data:
  164. ----
  165. gpsprof -f polarused -T jpeg -r < polar.json > polarused.plot
  166. gnuplot < polarused.plot > polarused.png
  167. gpsprof -f polarunused -T jpeg -r < polar.json > polarunused.plot
  168. gnuplot < polarunused.plot > polarunused.png
  169. ----
  170. You can split the pieces up, so you do not need to run the entire chain
  171. at once. To allow tweaking settings without recollecting all the data.
  172. Like this:
  173. ----
  174. gpspipe -w -x 3600 ::/dev/ttyS0 > MY.raw
  175. gpsdecode < MY.raw > MY.json
  176. gpsprof -r -T pngcairo -t "MY Title" < MY.json > MY.plt
  177. gnuplot MY.plt > MY.png
  178. display MY.png
  179. ----
  180. The *gpspipe* saves one hour of raw data from the local *gpsd* device
  181. /dev/ttyS0 into MY.raw. It will take one hour to complete.
  182. The *gpsdecode* converts the raw data in MY.raw into a *gpsd* JSON file
  183. called MY.json.
  184. The *gpsprof* reads MY.json and creates a *gnuplot* program in MY.plt.
  185. The *gnuplot* executes the program in MY.plt and creates the image
  186. file MY.png.
  187. The *display* program paints MY.png on your desktop.
  188. == RETURN VALUES
  189. *0*:: on success.
  190. *1*:: on failure
  191. == SEE ALSO
  192. *gpsd*(8), *display*(1), *gnuplot*(1), *gpsctl*(1), *gps*(1),
  193. *libgps*(3), *libgpsmm*(3), *gpsprof*(1), *gpsfake*(1).
  194. == RESOURCES
  195. *Project web site:* {gpsdweb}
  196. == COPYING
  197. This file is Copyright 2013 by the GPSD project +
  198. SPDX-License-Identifier: BSD-2-clause