【问题标题】:Difference in time stamps between /proc/uptime and dmesg/proc/uptime 和 dmesg 之间的时间戳差异
【发布时间】:2019-03-09 23:16:15
【问题描述】:

今天我注意到运行 redhat 7.3 的 Linux 机器中的时间戳存在问题。 dmesg 中显示的时间戳在 /proc/uptime 中显示的时间戳之后

# echo TEST > /dev/kmsg &&  dmesg | tail -1 && cat /proc/uptime
  [661503.956980] TEST
  661301.99 15107232.56

据我了解,它们都显示自内核初始化以来经过的秒数。那么是什么导致了这里的差异呢?

【问题讨论】:

    标签: linux time kernel uptime dmesg


    【解决方案1】:

    dmesg 时间戳显示 CLOCK_MONOTONIC,而 /proc/uptime 显示 CLOCK_BOOTTIME。

    有关 CLOCK_* 的详细信息,请参阅“man timer_create”。

    【讨论】:

      猜你喜欢
      • 2012-12-14
      • 2014-03-05
      • 2014-06-09
      • 1970-01-01
      • 1970-01-01
      • 2021-01-23
      • 2017-01-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多