Skip to content

clock("MONOTONIC_RAW") support #426

Description

@geldot

Consider adding CLOCK_MONOTONIC_RAW support to clock().

It was found that clock frequency values are broken in some device trees in the OpenWRT project, but there is currently no good way to diagnose the issue so it has remained broken for years.

See openwrt/openwrt#24789 (comment)

CLOCK_MONOTONIC_RAW (since Linux 2.6.28; Linux-specific)
              Similar to CLOCK_MONOTONIC, but provides access to a raw hard‐
              ware-based time that is not subject to NTP adjustments or the
              incremental adjustments performed by [adjtime(3)](https://man7.org/linux/man-pages/man3/adjtime.3.html).  This clock
              does not count time that the system is suspended.

Once there is an easy way to get this value, it becomes possible to measure the delta between the raw monotonic clock and either the browser's clock (LuCI), wall clock, or NTP etc. source. This will help determine which dts need patching and whether certain skews are common across multiple devices.

The exact API shape is inconsequential - it could be be represented as a new integer argument, extending the previous two modes (0, 1, 2) or a string argument. Your call

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions