diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2008-12-27 09:15:40 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2008-12-27 09:15:40 +0000 |
commit | e6b2b986ff8c91f2ec1f8dbc05a62f5bf9fcd91b (patch) | |
tree | a0b4e270d5b7fdf0c2e9aa2551c29bce51dc088a /garmin_txt.c | |
parent | d4bee24389232b37dd0ae816789806f8fe1f34fa (diff) | |
download | gpsd-e6b2b986ff8c91f2ec1f8dbc05a62f5bf9fcd91b.tar.gz |
Add a wrapper function around gpsd_hexdump to avoid hexdumping buffers...
...and copying ascii strings around when they're not going to be printed.
This saves quite a lot of CPU. I processed a 50MB ubx binary file. With
no "-D" options, this saved nearly 2.2M calls to gpsd_hexdump and the
processing time for this file went from 84 seconds to 35 seconds.
Diffstat (limited to 'garmin_txt.c')
-rw-r--r-- | garmin_txt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/garmin_txt.c b/garmin_txt.c index 19f552af..ecd13aac 100644 --- a/garmin_txt.c +++ b/garmin_txt.c @@ -268,8 +268,11 @@ gps_mask_t garmintxt_parse(struct gps_device_t *session) gps_mask_t mask = 0; - gpsd_report(LOG_PROG, "Garmin Simple Text packet, len %d\n", session->packet.outbuflen); - gpsd_report(LOG_RAW, "%s\n", gpsd_hexdump(session->packet.outbuffer, session->packet.outbuflen)); + gpsd_report(LOG_PROG, "Garmin Simple Text packet, len %d\n", + session->packet.outbuflen); + gpsd_report(LOG_RAW, "%s\n", + gpsd_hexdump_wrapper(session->packet.outbuffer, + session->packet.outbuflen, LOG_RAW)); if (session->packet.outbuflen < 56) { gpsd_report(LOG_WARN, "Message too short, rejected.\n"); |