From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Laurent Georget
<laurent.georget-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>,
linux-man <linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jeff Epler <jepler-ixP+gI44yfQ4d9/VWYMlNA@public.gmane.org>,
Richard Cochran
<richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 1/2] adjtimex.2: Clarify the 'ppm scaling' used in struct timex
Date: Tue, 06 Jan 2015 16:19:00 +0100 [thread overview]
Message-ID: <54ABFCE4.4050804@gmail.com> (raw)
In-Reply-To: <54A72360.3070807-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
Hi Laurent,
On 01/03/2015 12:01 AM, Laurent Georget wrote:
> Hi,
>
> this is the last version of a new series of patchs for adjtimex.2.
> Please ignore all previous versions of this series.
>
> This patch makes explicit and clarifies the unit used for fields
> "freq", "ppsfreq" and "stabil" in struct timex.
> It closes a FIXME in the man page.
Thanks -- nice work pulling together the input of Richard and Jeff.
Patch applied.
> Reviewed-By: Jeff Epler <jepler-ixP+gI44yfQ4d9/VWYMlNA@public.gmane.org>
And for good measure I threw in a "Reviewed-by" from Richard as well.
Thanks,
Michael
>
> ---
> man2/adjtimex.2 | 21 ++++++++++++++++-----
> 1 file changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/man2/adjtimex.2 b/man2/adjtimex.2
> index 18823c8..ff4b23e 100644
> --- a/man2/adjtimex.2
> +++ b/man2/adjtimex.2
> @@ -54,9 +54,8 @@ struct timex {
> long offset; /* Time offset; nanoseconds, if STA_NANO
> status flag is set, otherwise
> microseconds */
> - long freq; /* Frequency offset, as scaled PPM
> - (parts per million) */
> -.\" FIXME What is the scaling unit of timex.freq? 2^16 ?
> + long freq; /* Frequency offset, in units of 2^-16 PPM
> + (parts per million) (see NOTES below) */
> long maxerror; /* Maximum error (microseconds) */
> long esterror; /* Estimated error (microseconds) */
> int status; /* Clock command/status */
> @@ -72,13 +71,13 @@ struct timex {
> flag is set, otherwise microseconds */
> long tick; /* Microseconds between clock ticks */
> long ppsfreq; /* PPS (pulse per second) frequency
> - (scaled PPM, read-only) */
> + (2^-16 PPM (see NOTES), read-only) */
> long jitter; /* PPS jitter (read-only); nanoseconds, if
> STA_NANO status flag is set, otherwise
> microseconds */
> int shift; /* PPS interval duration
> (seconds, read-only) */
> - long stabil; /* PPS stability (scaled PPM, read-only) */
> + long stabil; /* PPS stability (2^-16 PPM (see NOTES), read-only) */
> long jitcnt; /* PPS jitter limit exceeded (read-only) */
> long calcnt; /* PPS calibration intervals (read-only) */
> long errcnt; /* PPS calibration errors (read-only) */
> @@ -343,6 +342,18 @@ and the caller does not have sufficient privilege.
> Under Linux, the
> .B CAP_SYS_TIME
> capability is required.
> +.SH NOTES
> +In struct
> +.IR timex ,
> +.IR freq ,
> +.IR ppsfreq ,
> +and
> +.I stabil
> +are PPM (parts per million) with a 16-bits fractional part, which means that a
> +value of 1 in one of those fields actually means 2^-16 PPM, and 2^16=65535 is
> +1 PPM. This is the case for both input values (in the case of
> +.IR freq )
> +and output values.
> .SH CONFORMING TO
> .BR adjtimex ()
> is Linux-specific and should not be used in programs
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Laurent Georget <laurent.georget@supelec.fr>,
linux-man <linux-man@vger.kernel.org>
Cc: mtk.manpages@gmail.com, linux-kernel@vger.kernel.org,
Jeff Epler <jepler@unpythonic.net>,
Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH 1/2] adjtimex.2: Clarify the 'ppm scaling' used in struct timex
Date: Tue, 06 Jan 2015 16:19:00 +0100 [thread overview]
Message-ID: <54ABFCE4.4050804@gmail.com> (raw)
In-Reply-To: <54A72360.3070807@supelec.fr>
Hi Laurent,
On 01/03/2015 12:01 AM, Laurent Georget wrote:
> Hi,
>
> this is the last version of a new series of patchs for adjtimex.2.
> Please ignore all previous versions of this series.
>
> This patch makes explicit and clarifies the unit used for fields
> "freq", "ppsfreq" and "stabil" in struct timex.
> It closes a FIXME in the man page.
Thanks -- nice work pulling together the input of Richard and Jeff.
Patch applied.
> Reviewed-By: Jeff Epler <jepler@unpythonic.net>
And for good measure I threw in a "Reviewed-by" from Richard as well.
Thanks,
Michael
>
> ---
> man2/adjtimex.2 | 21 ++++++++++++++++-----
> 1 file changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/man2/adjtimex.2 b/man2/adjtimex.2
> index 18823c8..ff4b23e 100644
> --- a/man2/adjtimex.2
> +++ b/man2/adjtimex.2
> @@ -54,9 +54,8 @@ struct timex {
> long offset; /* Time offset; nanoseconds, if STA_NANO
> status flag is set, otherwise
> microseconds */
> - long freq; /* Frequency offset, as scaled PPM
> - (parts per million) */
> -.\" FIXME What is the scaling unit of timex.freq? 2^16 ?
> + long freq; /* Frequency offset, in units of 2^-16 PPM
> + (parts per million) (see NOTES below) */
> long maxerror; /* Maximum error (microseconds) */
> long esterror; /* Estimated error (microseconds) */
> int status; /* Clock command/status */
> @@ -72,13 +71,13 @@ struct timex {
> flag is set, otherwise microseconds */
> long tick; /* Microseconds between clock ticks */
> long ppsfreq; /* PPS (pulse per second) frequency
> - (scaled PPM, read-only) */
> + (2^-16 PPM (see NOTES), read-only) */
> long jitter; /* PPS jitter (read-only); nanoseconds, if
> STA_NANO status flag is set, otherwise
> microseconds */
> int shift; /* PPS interval duration
> (seconds, read-only) */
> - long stabil; /* PPS stability (scaled PPM, read-only) */
> + long stabil; /* PPS stability (2^-16 PPM (see NOTES), read-only) */
> long jitcnt; /* PPS jitter limit exceeded (read-only) */
> long calcnt; /* PPS calibration intervals (read-only) */
> long errcnt; /* PPS calibration errors (read-only) */
> @@ -343,6 +342,18 @@ and the caller does not have sufficient privilege.
> Under Linux, the
> .B CAP_SYS_TIME
> capability is required.
> +.SH NOTES
> +In struct
> +.IR timex ,
> +.IR freq ,
> +.IR ppsfreq ,
> +and
> +.I stabil
> +are PPM (parts per million) with a 16-bits fractional part, which means that a
> +value of 1 in one of those fields actually means 2^-16 PPM, and 2^16=65535 is
> +1 PPM. This is the case for both input values (in the case of
> +.IR freq )
> +and output values.
> .SH CONFORMING TO
> .BR adjtimex ()
> is Linux-specific and should not be used in programs
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
next prev parent reply other threads:[~2015-01-06 15:19 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-30 17:19 [PATCH] adjtimex.2: Add details about ADJ_FREQUENCY Laurent Georget
2014-12-30 17:19 ` Laurent Georget
[not found] ` <54A2DEAD.2050708-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
2014-12-30 18:05 ` Richard Cochran
2014-12-30 18:05 ` Richard Cochran
[not found] ` <20141230180549.GB7403-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2014-12-30 18:47 ` Laurent Georget
2014-12-30 18:47 ` Laurent Georget
2015-01-02 2:41 ` [PATCH] adjtimex: PPM scaling is by 2^-16 Jeff Epler
2015-01-02 2:41 ` Jeff Epler
2015-01-02 6:29 ` Richard Cochran
[not found] ` <20150102062920.GB4221-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2015-01-02 16:39 ` Laurent Georget
2015-01-02 16:39 ` Laurent Georget
[not found] ` <54A6C9B5.4050904-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
2015-01-02 18:51 ` Richard Cochran
2015-01-02 18:51 ` Richard Cochran
2015-01-02 21:15 ` Jeff Epler
2015-01-02 21:15 ` Jeff Epler
[not found] ` <20150102211519.GA55815-ixP+gI44yfQ4d9/VWYMlNA@public.gmane.org>
2015-01-02 22:48 ` Laurent Georget
2015-01-02 22:48 ` Laurent Georget
2015-01-02 23:01 ` [PATCH 1/2] adjtimex.2: Clarify the 'ppm scaling' used in struct timex Laurent Georget
2015-01-02 23:01 ` Laurent Georget
2015-01-02 23:07 ` [PATCH 2/2] adjtimex.2: Change 'PPM' (parts per million) to 'ppm' Laurent Georget
[not found] ` <54A724BE.8050409-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
2015-01-06 15:20 ` Michael Kerrisk (man-pages)
2015-01-06 15:20 ` Michael Kerrisk (man-pages)
[not found] ` <54ABFD54.9000705-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-06 15:42 ` Laurent Georget
[not found] ` <54AC0250.5080005-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
2015-01-07 5:59 ` Michael Kerrisk (man-pages)
[not found] ` <54ACCB28.50100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-08 16:29 ` Laurent Georget
[not found] ` <54A72360.3070807-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
2015-01-06 15:19 ` Michael Kerrisk (man-pages) [this message]
2015-01-06 15:19 ` [PATCH 1/2] adjtimex.2: Clarify the 'ppm scaling' used in struct timex Michael Kerrisk (man-pages)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54ABFCE4.4050804@gmail.com \
--to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=jepler-ixP+gI44yfQ4d9/VWYMlNA@public.gmane.org \
--cc=laurent.georget-vbcOdlJ0SulGWvitb5QawA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.