Bug 1824084 Comment 15 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Now that i'm rereading the manpages and freebsd's code and openbsd's code, i understand things aren't so simple, since Linux, OpenBSD and FreeBSD don't seem to agree on the BOOTTIME/UPTIME meaning.

FreeBSD's manpage says
> Finally, CLOCK_BOOTTIME is an alias for CLOCK_UPTIME for compatibility with other systems.

while for OpenBSD's, the code and the manpage seems to mean that CLOCK_UPTIME should be used in `NowExcludingSuspendMs` and CLOCK_BOOTIME in `
NowIncludingSuspendMs`. The more i think about it, the more it seems https://phabricator.services.mozilla.com/D101748 was right.

to check the values, in about:telemetry i'm checking `browser.engagement.session_time_including_suspend` and `browser.engagement.session_time_excluding_suspend`  in the scalars/parent tree. With my current fix (adding `|| defined (XP_OPENBSD)`, i have the same values for both, even after a suspend/resume session.

Will recheck with an adaptation/update of the aforementioned bitrotten patch. Val, did you end up with the same analysis as me ?

Of course, just replacing XP_LINUX by XP_UNIX wont break build for any BSD platform and will enable telemetry, just with a single value not reporting 'correct' information for OpenBSD. It's a simpler patch, but should we strive for absolute correctness and do the #ifdef dance ?
Now that i'm rereading the manpages and freebsd's code and openbsd's code, i understand things aren't so simple, since Linux, OpenBSD and FreeBSD don't seem to agree on the BOOTTIME/UPTIME meaning.

FreeBSD's manpage says
> Finally, CLOCK_BOOTTIME is an alias for CLOCK_UPTIME for compatibility with other systems.

while for OpenBSD's, the code in https://github.com/openbsd/src/blob/50603113d13b32b82b4569f48902052db016a195/sys/kern/kern_time.c#L119 and the manpage seems to mean that CLOCK_UPTIME should be used in `NowExcludingSuspendMs` and CLOCK_BOOTIME in `
NowIncludingSuspendMs`. The more i think about it, the more it seems https://phabricator.services.mozilla.com/D101748 was right.

to check the values, in about:telemetry i'm checking `browser.engagement.session_time_including_suspend` and `browser.engagement.session_time_excluding_suspend`  in the scalars/parent tree. With my current fix (adding `|| defined (XP_OPENBSD)`, i have the same values for both, even after a suspend/resume session.

Will recheck with an adaptation/update of the aforementioned bitrotten patch. Val, did you end up with the same analysis as me ?

Of course, just replacing XP_LINUX by XP_UNIX wont break build for any BSD platform and will enable telemetry, just with a single value not reporting 'correct' information for OpenBSD. It's a simpler patch, but should we strive for absolute correctness and do the #ifdef dance ?
Now that i'm rereading the manpages and freebsd's code and openbsd's code, i understand things aren't so simple, since Linux, OpenBSD and FreeBSD don't seem to agree on the BOOTTIME/UPTIME meaning.

FreeBSD's manpage says
> Finally, CLOCK_BOOTTIME is an alias for CLOCK_UPTIME for compatibility with other systems.

while for OpenBSD's, the code in https://github.com/openbsd/src/blob/50603113d13b32b82b4569f48902052db016a195/sys/kern/kern_time.c#L119 and the manpage seems to mean that CLOCK_UPTIME should be used in `NowExcludingSuspendMs` and CLOCK_BOOTIME in `
NowIncludingSuspendMs`. The more i think about it, the more it seems https://phabricator.services.mozilla.com/D101748 was right.

to check the values, in about:telemetry i'm checking `browser.engagement.session_time_including_suspend` and `browser.engagement.session_time_excluding_suspend`  in the scalars/parent tree. (eg `about:telemetry#scalars-tab_search=sus`) With my current fix (adding `|| defined (XP_OPENBSD)`, i have the same values for both, even after a suspend/resume session.

Will recheck with an adaptation/update of the aforementioned bitrotten patch. Val, did you end up with the same analysis as me ?

Of course, just replacing XP_LINUX by XP_UNIX wont break build for any BSD platform and will enable telemetry, just with a single value not reporting 'correct' information for OpenBSD. It's a simpler patch, but should we strive for absolute correctness and do the #ifdef dance ?

Back to Bug 1824084 Comment 15