diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-09-22 03:00:57 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-09-22 03:00:57 -0400 |
commit | 2e125acaf727e8d8e6662e57be4594fcdec7a7da (patch) | |
tree | 0541738d73ed048908dd66be0271095712a76a66 /gpspipe.c | |
parent | 15c7578266d06d7f0b7f8be8e66c075252a061e6 (diff) | |
download | gpsd-2e125acaf727e8d8e6662e57be4594fcdec7a7da.tar.gz |
Asdd a gpspipe option to enable profiling.
Diffstat (limited to 'gpspipe.c')
-rw-r--r-- | gpspipe.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -105,6 +105,7 @@ static void usage(void) "-s [serial dev] emulate a 4800bps NMEA GPS on serial port (use with '-r').\n" "-n [count] exit after count packets.\n" "-v Print a little spinner.\n" + "-p Include profiling info in the JSON.\n" "-V Print version and exit.\n\n" "You must specify one, or more, of -r, -R, or -w\n" "You must use -o if you use -d.\n"); @@ -123,6 +124,7 @@ int main(int argc, char **argv) bool new_line = true; bool raw = false; bool watch = false; + bool profile = false; long count = -1; int option; unsigned int vflag = 0, l = 0; @@ -136,7 +138,7 @@ int main(int argc, char **argv) /*@-branchstate@*/ flags = WATCH_ENABLE; - while ((option = getopt(argc, argv, "?dD:lhrRwtT:vVn:s:o:")) != -1) { + while ((option = getopt(argc, argv, "?dD:lhrRwtT:vVn:s:o:p")) != -1) { switch (option) { case 'D': debug = atoi(optarg); @@ -179,6 +181,9 @@ int main(int argc, char **argv) flags |= WATCH_JSON; watch = true; break; + case 'p': + profile = true; + break; case 'V': (void)fprintf(stderr, "%s: %s (revision %s)\n", argv[0], VERSION, REVISION); @@ -265,6 +270,8 @@ int main(int argc, char **argv) } /*@ +nullpass +onlytrans @*/ + if (profile) + flags |= WATCH_TIMING; if (source.device != NULL) flags |= WATCH_DEVICE; (void)gps_stream(&gpsdata, flags, source.device); |