[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unexpected logging from gpsd

From: Gary E. Miller
Subject: Re: Unexpected logging from gpsd
Date: Sun, 10 Oct 2021 11:49:30 -0700

Yo Mick!

On Sun, 10 Oct 2021 15:45:58 +0100
Mick Durkin <> wrote:

> That still leaves me unclear why gpsd is outputting debug data all
> the time.

All the time?  I thought you said only for PPS stuff?

> When we want debugging to be active we specify the level
> with the -D n option at startup.


> This output is only coming from the
> ppsthread code within gpsd, so why would that code be different?

As the name says, the PPS code is in a thread.  C code in a thread has
to be written differently than non-threaed C code because C is not
inherently safe with threads.

Alsoat all the gpsd code uses GPSD_LOG() for logging.  But to avoid
I/O and buffer contention, the PPS thread code uses pps_thread->log_hook().

log_hook() points to ppsthread_log90 in gpsd/libgpsd_core.c

It uses similar log levels to GPSD_LOG():

log_hook() levels:

#define THREAD_ERROR    0
#define THREAD_WARN     1
#define THREAD_INF      2
#define THREAD_PROG     3
#define THREAD_RAW      4

GPSD_LOG() levels:

/* logging levels */
#define LOG_ERROR       -1      /* errors, display always */
#define LOG_SHOUT       0       /* not an error but we should always see it */
#define LOG_WARN        1       /* not errors but may indicate a problem */
#define LOG_CLIENT      2       /* log JSON reports to clients */
#define LOG_INF         3       /* key informative messages */
#define LOG_PROG        4       /* progress messages */
#define LOG_IO          5       /* IO to and from devices */
#define LOG_DATA        6       /* log data management messages */
#define LOG_SPIN        7       /* logging for catching spin bugs */
#define LOG_RAW         8       /* raw low-level I/O */
#define LOG_RAW1        9       // rawer
#define LOG_RAW2       10       // rawest

If you are getting debug level logs from log_hook() and not from GPSD_LOG()
then that points to some problem in log_hook() decding what to send
to the logs.

I'd still like the output of gpsdebuginfo.

And be sure that all traces of any previous gpsd installation have been
removed and that you started your build from a clean tree.

Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgpGiOQV5Kg5c.pgp
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]