udevadmはタイムスタンプの解析出力を監視します。

udevadmはタイムスタンプの解析出力を監視します。

出力を記録しており、udevadm monitorイベントの日時を印刷したいと思います。

これはそのログの1行です。

  UDEV  [529296.231213] remove   /devices/virtual/input/input46 (input)
  

udevadmのマニュアルページから:

  udevadm monitor [options]
     Listens to the kernel uevents and events sent out by a udev rule and prints the devpath of the event to the console. It can be used to analyze the event timing, by comparing the timestamps of the kernel uevent and the udev event.
     

このタイムスタンプ529296.231213を実際の日付時刻に変換する方法。 Pythonで解析します。

timestamp = 529296.231213
dt = datetime.datetime.fromtimestamp(timestamp)

制作日1986-06-12 11:51:36.231213は2023年4月27日遅い午後です。

ベストアンサー1

おすすめ記事