[Bug 291917] [PATCH] dmesg(8): add -T to print timestamps as local datetime

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 24 Dec 2025 13:55:22 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291917

            Bug ID: 291917
           Summary: [PATCH] dmesg(8): add -T to print timestamps as local
                    datetime
           Product: Base System
           Version: 16.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: leah@vuxu.org

Created attachment 266503
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=266503&action=edit
patch

By setting the sysctl kern.msgbuf_show_timestamp, the kernel adds timestamps to
each dmesg line. However, there is no convenient way to resolve these into
absolute timestamps.  Add a flag -T to dmesg to provide this.
High precision timestamps (=2) will be printed with microseconds.

Adding the functionality to work with -M turned out to be a bit tricky, I had
to copy the definition of struct timehands... perhaps this should be moved into
a system header?

This issue came up at
https://lists.freebsd.org/archives/freebsd-stable/2025-December/003739.html

-- 
You are receiving this mail because:
You are the assignee for the bug.