• kern.msgbuf_show_timestamp=1

    From void@void@f-m.fm to muc.lists.freebsd.stable on Fri Dec 19 17:21:28 2025
    From Newsgroup: muc.lists.freebsd.stable

    Hi,

    In /etc/sysctl.conf I have

    kern.msgbuf_show_timestamp=1

    and so dmsg has things like

    [1353919] swp_pager_getswapspace(32): failed

    the [1353919] I guess being the timestamp.

    But what is it?

    Seconds since boot?

    If it's that, then where can the true boot time be
    found?

    If not, then what does the number signify?
    --


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jamie Landeg-Jones@jamie@catflap.org to muc.lists.freebsd.stable on Fri Dec 19 20:37:41 2025
    From Newsgroup: muc.lists.freebsd.stable

    void <void@f-m.fm> wrote:

    Hi,

    In /etc/sysctl.conf I have

    kern.msgbuf_show_timestamp=1

    and so dmsg has things like

    [1353919] swp_pager_getswapspace(32): failed

    the [1353919] I guess being the timestamp.

    But what is it?

    Seconds since boot?

    If it's that, then where can the true boot time be
    found?

    Yes! You can get the value from sysctl kern.boottime.

    Here is a small program I wrote a while back, just call it
    as a dmesg substitute.

    It uses gawk because of strftime, but now that native awk handles strftime,
    it could be converted to use that (gensub will have to be modified)

    gawk is in lang/gawk

    Incidentally, if you put the kern.msgbuf_show_timestamp=1
    in boot/loader.conf instead, it starts much earlier in the boot process,
    useful if you are anal about the format of bootup dmesg output!

    Cheers, Jamie

    #!/bin/sh -efu
    set -efu

    boottime="$(/sbin/sysctl -n kern.boottime | /usr/local/bin/gawk '{printf "%d", gensub ("^.* sec = ([1-9][0-9]*), .*$", "\\1", 1)}')"

    [ -z "$(printf '%s' "$boottime" | /usr/bin/egrep '^0$|^[1-9][0-9]*$')" ] && { printf 'Invalid boottime retrieved.\n' >& 2; exit 1; }

    /sbin/dmesg "$@" | /usr/local/bin/gawk -v boottime="$boottime" '

    {
    uptime = gensub ("^\\[([1-9][0-9]*)\\] .*$", "\\1", 1)
    if (uptime == $0) realtime = "??? ?? ??:??;??"
    else realtime = strftime ("%b %d %T", uptime + boottime)

    print realtime " " $0
    }'


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Warner Losh@imp@bsdimp.com to muc.lists.freebsd.stable on Fri Dec 19 15:45:06 2025
    From Newsgroup: muc.lists.freebsd.stable

    --000000000000e3297a064655d4c2
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    On Fri, Dec 19, 2025 at 10:22=E2=80=AFAM void <void@f-m.fm> wrote:

    Hi,

    In /etc/sysctl.conf I have

    kern.msgbuf_show_timestamp=3D1

    and so dmsg has things like

    [1353919] swp_pager_getswapspace(32): failed

    the [1353919] I guess being the timestamp.

    But what is it?

    Seconds since boot?

    If it's that, then where can the true boot time be
    found?


    Seconds since boot time.

    % sysctl kern.boottime
    kern.boottime: { sec =3D 1765407044, usec =3D 678571 } Wed Dec 10 15:50:44 = 2025

    Warner



    If not, then what does the number signify?





    --



    --000000000000e3297a064655d4c2
    Content-Type: text/html; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g= mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Dec 19,=
    2025 at 10:22=E2=80=AFAM void &lt;<a href=3D"mailto:void@f-m.fm">void@f-m.= fm</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi= n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex= ">Hi,<br>

    In /etc/sysctl.conf I have<br>

    kern.msgbuf_show_timestamp=3D1<br>

    and so dmsg has things like<br>

    [1353919] swp_pager_getswapspace(32): failed<br>

    the [1353919] I guess being the timestamp.<br>

    But what is it?<br>

    Seconds since boot?<br>

    If it&#39;s that, then where can the true boot time be <br> found?<br></blockquote><div><br></div><div>Seconds since boot time.</div><d= iv><br></div><div>% sysctl=C2=A0kern.boottime</div><div>kern.boottime: { se=
    c =3D 1765407044, usec =3D 678571 } Wed Dec 10 15:50:44 2025</div><div><br>= </div><div>Warner</div><div><br></div><div>=C2=A0</div><blockquote class=3D= "gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2= 04,204,204);padding-left:1ex">
    If not, then what does the number signify?<br>





    -- <br>

    </blockquote></div></div>

    --000000000000e3297a064655d4c2--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Warner Losh@imp@bsdimp.com to muc.lists.freebsd.stable on Fri Dec 19 15:47:28 2025
    From Newsgroup: muc.lists.freebsd.stable

    --0000000000004f8519064655dd82
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    On Fri, Dec 19, 2025 at 1:38=E2=80=AFPM Jamie Landeg-Jones <jamie@catflap.o=

    wrote:

    void <void@f-m.fm> wrote:

    Hi,

    In /etc/sysctl.conf I have

    kern.msgbuf_show_timestamp=3D1

    and so dmsg has things like

    [1353919] swp_pager_getswapspace(32): failed

    the [1353919] I guess being the timestamp.

    But what is it?

    Seconds since boot?

    If it's that, then where can the true boot time be
    found?

    Yes! You can get the value from sysctl kern.boottime.

    Here is a small program I wrote a while back, just call it
    as a dmesg substitute.

    It uses gawk because of strftime, but now that native awk handles strftim=
    e,
    it could be converted to use that (gensub will have to be modified)

    gawk is in lang/gawk

    Incidentally, if you put the kern.msgbuf_show_timestamp=3D1
    in boot/loader.conf instead, it starts much earlier in the boot process, useful if you are anal about the format of bootup dmesg output!

    Cheers, Jamie

    #!/bin/sh -efu
    set -efu

    boottime=3D"$(/sbin/sysctl -n kern.boottime | /usr/local/bin/gawk '{print=
    f
    "%d", gensub ("^.* sec =3D ([1-9][0-9]*), .*$", "\\1", 1)}')"

    [ -z "$(printf '%s' "$boottime" | /usr/bin/egrep '^0$|^[1-9][0-9]*$')" ]
    && { printf 'Invalid boottime retrieved.\n' >& 2; exit 1; }

    /sbin/dmesg "$@" | /usr/local/bin/gawk -v boottime=3D"$boottime" '

    {
    uptime =3D gensub ("^\\[([1-9][0-9]*)\\] .*$", "\\1", 1)
    if (uptime =3D=3D $0) realtime =3D "??? ?? ??:??;??"
    else realtime =3D strftime ("%b %d %T", uptime + boottime)

    print realtime " " $0
    }'


    Very cool!

    Warner

    --0000000000004f8519064655dd82
    Content-Type: text/html; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g= mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Dec 19,=
    2025 at 1:38=E2=80=AFPM Jamie Landeg-Jones &lt;<a href=3D"mailto:jamie@cat= flap.org">jamie@catflap.org</a>&gt; wrote:<br></div><blockquote class=3D"gm= ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,= 204,204);padding-left:1ex">void &lt;<a href=3D"mailto:void@f-m.fm" target= =3D"_blank">void@f-m.fm</a>&gt; wrote:<br>

    &gt; Hi,<br>
    &gt;<br>
    &gt; In /etc/sysctl.conf I have<br>
    &gt;<br>
    &gt; kern.msgbuf_show_timestamp=3D1<br>
    &gt;<br>
    &gt; and so dmsg has things like<br>
    &gt;<br>
    &gt; [1353919] swp_pager_getswapspace(32): failed<br>
    &gt;<br>
    &gt; the [1353919] I guess being the timestamp.<br>
    &gt;<br>
    &gt; But what is it?<br>
    &gt;<br>
    &gt; Seconds since boot?<br>
    &gt;<br>
    &gt; If it&#39;s that, then where can the true boot time be <br>
    &gt; found?<br>

    Yes! You can get the value from sysctl kern.boottime.<br>

    Here is a small program I wrote a while back, just call it<br>
    as a dmesg substitute.<br>

    It uses gawk because of strftime, but now that native awk handles strftime,=

    it could be converted to use that (gensub will have to be modified)<br>

    gawk is in lang/gawk<br>

    Incidentally, if you put the kern.msgbuf_show_timestamp=3D1<br>
    in boot/loader.conf instead, it starts much earlier in the boot process,<br=

    useful if you are anal about the format of bootup dmesg output!<br>

    Cheers, Jamie<br>

    #!/bin/sh -efu<br>
    set -efu<br>

    boottime=3D&quot;$(/sbin/sysctl -n kern.boottime | /usr/local/bin/gawk &#39= ;{printf &quot;%d&quot;, gensub (&quot;^.* sec =3D ([1-9][0-9]*), .*$&quot;=
    , &quot;\\1&quot;, 1)}&#39;)&quot;<br>

    [ -z &quot;$(printf &#39;%s&#39; &quot;$boottime&quot; | /usr/bin/egrep &#3= 9;^0$|^[1-9][0-9]*$&#39;)&quot; ] &amp;&amp; { printf &#39;Invalid boottime=
    retrieved.\n&#39; &gt;&amp; 2; exit 1; }<br>

    /sbin/dmesg &quot;$@&quot; | /usr/local/bin/gawk -v boottime=3D&quot;$boott= ime&quot; &#39;<br>

    =C2=A0 =C2=A0 {<br>
    =C2=A0 =C2=A0 =C2=A0 uptime =3D gensub (&quot;^\\[([1-9][0-9]*)\\] .*$&quot=
    ;, &quot;\\1&quot;, 1)<br>
    =C2=A0 =C2=A0 =C2=A0 if (uptime =3D=3D $0) realtime =3D &quot;??? ?? ??:??;= ??&quot;<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0else realtime =3D strftime (&quot;%b %d %T&quot;=
    , uptime + boottime)<br>

    =C2=A0 =C2=A0 =C2=A0 print realtime &quot; &quot; $0<br>
    =C2=A0 =C2=A0 }&#39;<br></blockquote><div><br></div><div>Very cool!</div><d= iv><br></div><div>Warner=C2=A0</div></div></div>

    --0000000000004f8519064655dd82--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jamie Landeg-Jones@jamie@catflap.org to muc.lists.freebsd.stable on Sat Dec 20 02:10:31 2025
    From Newsgroup: muc.lists.freebsd.stable

    Warner Losh <imp@bsdimp.com> wrote:

    Very cool!

    Thanks! I always intended on adding this option to the dmesg command
    itself, but as with most things I fiddle with, the itch scratching
    stopped at the point of achieving an AWK wrapper script around the
    original command, so instead it got relegated to the ever expanding
    TODO list!

    Cheers, Jamie


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From void@void@f-m.fm to muc.lists.freebsd.stable on Sat Dec 20 02:46:59 2025
    From Newsgroup: muc.lists.freebsd.stable

    On Fri, Dec 19, 2025 at 08:37:41PM +0000, Jamie Landeg-Jones wrote:
    Yes! You can get the value from sysctl kern.boottime.

    Here is a small program I wrote a while back, just call it
    as a dmesg substitute.

    This is great TYVM!
    --


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Andre Albsmeier@mail@fbsd2.e4m.org to muc.lists.freebsd.stable on Thu Jan 22 09:46:25 2026
    From Newsgroup: muc.lists.freebsd.stable

    On Fri, 19-Dec-2025 at 20:37:41 +0000, Jamie Landeg-Jones wrote:
    void <void@f-m.fm> wrote:

    ...
    and so dmsg has things like

    [1353919] swp_pager_getswapspace(32): failed

    the [1353919] I guess being the timestamp.

    ...

    Yes! You can get the value from sysctl kern.boottime.

    Here is a small program I wrote a while back, just call it
    as a dmesg substitute.
    ...
    Cheers, Jamie

    #!/bin/sh -efu
    set -efu

    boottime="$(/sbin/sysctl -n kern.boottime | /usr/local/bin/gawk '{printf "%d", gensub ("^.* sec = ([1-9][0-9]*), .*$", "\\1", 1)}')"

    [ -z "$(printf '%s' "$boottime" | /usr/bin/egrep '^0$|^[1-9][0-9]*$')" ] && { printf 'Invalid boottime retrieved.\n' >& 2; exit 1; }

    /sbin/dmesg "$@" | /usr/local/bin/gawk -v boottime="$boottime" '

    {
    uptime = gensub ("^\\[([1-9][0-9]*)\\] .*$", "\\1", 1)
    if (uptime == $0) realtime = "??? ?? ??:??;??"
    else realtime = strftime ("%b %d %T", uptime + boottime)

    print realtime " " $0
    }'

    FWIW, this is a patch for dmesg(1) I use. You can enable timestamp
    conversion using -t and optionally specify a different output format
    using -f "fmt".

    If interested for inclusion in base, I could try to re-format it
    and come up with a manpage diff...

    --- sbin/dmesg/dmesg.c 2023-12-27 17:49:57.000000000 +0100
    +++ sbin/dmesg/dmesg.c 2026-01-22 09:20:28.987020000 +0100
    @@ -60,6 +60,7 @@
    #include <unistd.h>
    #include <vis.h>
    #include <sys/syslog.h>
    +#include <time.h>

    static struct nlist nl[] = {
    #define X_MSGBUF 0
    @@ -76,18 +77,23 @@
    main(int argc, char *argv[])
    {
    struct msgbuf *bufp, cur;
    + struct timeval boottime;
    + char timebuf[64];
    char *bp, *ep, *memf, *nextp, *nlistf, *p, *q, *visbp;
    + const char *timefmt = "%d %b %T";
    kvm_t *kd;
    + time_t time;
    size_t buflen, bufpos;
    long pri;
    - int ch, clear;
    + int ch, clear, timeconv;
    bool all;

    all = false;
    clear = false;
    + timeconv = false;
    (void) setlocale(LC_CTYPE, "");
    memf = nlistf = NULL;
    - while ((ch = getopt(argc, argv, "acM:N:")) != -1)
    + while ((ch = getopt(argc, argv, "actf:M:N:")) != -1)
    switch(ch) {
    case 'a':
    all = true;
    @@ -95,6 +101,12 @@
    case 'c':
    clear = true;
    break;
    + case 't':
    + timeconv = true;
    + break;
    + case 'f':
    + timefmt = optarg;
    + break;
    case 'M':
    memf = optarg;
    break;
    @@ -109,6 +121,13 @@
    if (argc != 0)
    usage();

    + if( timeconv ) {
    + int mib[6] = { CTL_KERN, KERN_BOOTTIME };
    + size_t l = sizeof boottime;
    + if (sysctl(mib, 2, &boottime, &l, 0, 0) < 0)
    + err(1, "sysctl kern.boottime");
    + }
    +
    if (memf == NULL) {
    /*
    * Running kernel. Use sysctl. This gives an unwrapped buffer @@ -200,7 +219,22 @@
    }

    (void)strvisx(visbp, p, nextp - p, 0);
    - (void)printf("%s", visbp);
    + bufpos = strspn( visbp+1, "0123456789" ) + 1;
    + if( timeconv != true
    + || bufpos < 2
    + || visbp[0] != '['
    + || visbp[bufpos] != ']'
    + || visbp[bufpos+1] != ' ' ) {
    + (void)printf("%s", visbp);
    + continue;
    + }
    +
    + visbp[bufpos] = '\0';
    + time = boottime.tv_sec + strtoull( visbp+1, NULL, 10 );
    + if( strftime( timebuf, sizeof timebuf, timefmt, localtime( &time ) ) != 0 )
    + (void)printf( "[%s]%s", timebuf, visbp + bufpos + 1 ); + else
    + (void)printf("%s", visbp);
    }
    exit(0);
    }
    @@ -208,6 +242,6 @@
    void
    usage(void)
    {
    - fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n");
    + fprintf(stderr, "usage: dmesg [-ac] [-t [-f output_fmt]] [-M core [-N system]]\n");
    exit(1);
    }


    -Andre


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Kurt Jaeger@pi@freebsd.org to muc.lists.freebsd.stable on Thu Jan 22 11:20:29 2026
    From Newsgroup: muc.lists.freebsd.stable

    Hi!

    FWIW, this is a patch for dmesg(1) I use. You can enable timestamp
    conversion using -t and optionally specify a different output format
    using -f "fmt".

    If interested for inclusion in base, I could try to re-format it
    and come up with a manpage diff...

    Oh yes, please!

    --- sbin/dmesg/dmesg.c 2023-12-27 17:49:57.000000000 +0100
    +++ sbin/dmesg/dmesg.c 2026-01-22 09:20:28.987020000 +0100
    @@ -60,6 +60,7 @@
    #include <unistd.h>
    #include <vis.h>
    #include <sys/syslog.h>
    +#include <time.h>

    static struct nlist nl[] = {
    #define X_MSGBUF 0
    @@ -76,18 +77,23 @@
    main(int argc, char *argv[])
    {
    struct msgbuf *bufp, cur;
    + struct timeval boottime;
    + char timebuf[64];
    char *bp, *ep, *memf, *nextp, *nlistf, *p, *q, *visbp;
    + const char *timefmt = "%d %b %T";
    kvm_t *kd;
    + time_t time;
    size_t buflen, bufpos;
    long pri;
    - int ch, clear;
    + int ch, clear, timeconv;
    bool all;

    all = false;
    clear = false;
    + timeconv = false;
    (void) setlocale(LC_CTYPE, "");
    memf = nlistf = NULL;
    - while ((ch = getopt(argc, argv, "acM:N:")) != -1)
    + while ((ch = getopt(argc, argv, "actf:M:N:")) != -1)
    switch(ch) {
    case 'a':
    all = true;
    @@ -95,6 +101,12 @@
    case 'c':
    clear = true;
    break;
    + case 't':
    + timeconv = true;
    + break;
    + case 'f':
    + timefmt = optarg;
    + break;
    case 'M':
    memf = optarg;
    break;
    @@ -109,6 +121,13 @@
    if (argc != 0)
    usage();

    + if( timeconv ) {
    + int mib[6] = { CTL_KERN, KERN_BOOTTIME };
    + size_t l = sizeof boottime;
    + if (sysctl(mib, 2, &boottime, &l, 0, 0) < 0)
    + err(1, "sysctl kern.boottime");
    + }
    +
    if (memf == NULL) {
    /*
    * Running kernel. Use sysctl. This gives an unwrapped buffer @@ -200,7 +219,22 @@
    }

    (void)strvisx(visbp, p, nextp - p, 0);
    - (void)printf("%s", visbp);
    + bufpos = strspn( visbp+1, "0123456789" ) + 1;
    + if( timeconv != true
    + || bufpos < 2
    + || visbp[0] != '['
    + || visbp[bufpos] != ']'
    + || visbp[bufpos+1] != ' ' ) {
    + (void)printf("%s", visbp);
    + continue;
    + }
    +
    + visbp[bufpos] = '\0';
    + time = boottime.tv_sec + strtoull( visbp+1, NULL, 10 );
    + if( strftime( timebuf, sizeof timebuf, timefmt, localtime( &time ) ) != 0 )
    + (void)printf( "[%s]%s", timebuf, visbp + bufpos + 1 ); + else
    + (void)printf("%s", visbp);
    }
    exit(0);
    }
    @@ -208,6 +242,6 @@
    void
    usage(void)
    {
    - fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n");
    + fprintf(stderr, "usage: dmesg [-ac] [-t [-f output_fmt]] [-M core [-N system]]\n");
    exit(1);
    }


    -Andre

    --
    pi@FreeBSD.org +49 171 3101372 Now what ?


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Pete French@pete@twisted.org.uk to muc.lists.freebsd.stable on Thu Jan 22 10:59:12 2026
    From Newsgroup: muc.lists.freebsd.stable



    On 22/01/2026 08:46, Andre Albsmeier wrote:
    FWIW, this is a patch for dmesg(1) I use. You can enable timestamp
    conversion using -t and optionally specify a different output format
    using -f "fmt".

    If interested for inclusion in base, I could try to re-format it
    and come up with a manpage diff...

    OH, this is excellent - works really well! Thankyou for this, its
    so useful, and yes, we should really get it into base if possible.

    -pete. [ off to deploy this everywhere ;) ]


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mark Linimon@linimon@portsmon.org to muc.lists.freebsd.stable on Thu Jan 22 09:09:33 2026
    From Newsgroup: muc.lists.freebsd.stable

    On 01/22/2026 2:46 AM CST Andre Albsmeier <mail@fbsd2.e4m.org>
    FWIW, this is a patch for dmesg(1) I use. You can enable timestamp
    conversion using -t and optionally specify a different output format
    using -f "fmt".

    If interested for inclusion in base, I could try to re-format it
    and come up with a manpage diff...

    Yes, please. We are gently trying to move away from inline patches
    in email and Bugzilla :-)

    mcl


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Warner Losh@imp@bsdimp.com to muc.lists.freebsd.stable on Thu Jan 22 08:31:15 2026
    From Newsgroup: muc.lists.freebsd.stable

    --000000000000f2a18e0648fbbbfc
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    On Thu, Jan 22, 2026 at 1:46=E2=80=AFAM Andre Albsmeier <mail@fbsd2.e4m.org=
    wrote:

    On Fri, 19-Dec-2025 at 20:37:41 +0000, Jamie Landeg-Jones wrote:
    void <void@f-m.fm> wrote:

    ...
    and so dmsg has things like

    [1353919] swp_pager_getswapspace(32): failed

    the [1353919] I guess being the timestamp.

    ...

    Yes! You can get the value from sysctl kern.boottime.

    Here is a small program I wrote a while back, just call it
    as a dmesg substitute.
    ...
    Cheers, Jamie

    #!/bin/sh -efu
    set -efu

    boottime=3D"$(/sbin/sysctl -n kern.boottime | /usr/local/bin/gawk '{pri=
    ntf
    "%d", gensub ("^.* sec =3D ([1-9][0-9]*), .*$", "\\1", 1)}')"

    [ -z "$(printf '%s' "$boottime" | /usr/bin/egrep '^0$|^[1-9][0-9]*$')" =
    ]
    && { printf 'Invalid boottime retrieved.\n' >& 2; exit 1; }

    /sbin/dmesg "$@" | /usr/local/bin/gawk -v boottime=3D"$boottime" '

    {
    uptime =3D gensub ("^\\[([1-9][0-9]*)\\] .*$", "\\1", 1)
    if (uptime =3D=3D $0) realtime =3D "??? ?? ??:??;??"
    else realtime =3D strftime ("%b %d %T", uptime + boottime)

    print realtime " " $0
    }'

    FWIW, this is a patch for dmesg(1) I use. You can enable timestamp
    conversion using -t and optionally specify a different output format
    using -f "fmt".

    If interested for inclusion in base, I could try to re-format it
    and come up with a manpage diff...


    Yes. I've done a quick review inline.


    --- sbin/dmesg/dmesg.c 2023-12-27 17:49:57.000000000 +0100
    +++ sbin/dmesg/dmesg.c 2026-01-22 09:20:28.987020000 +0100
    @@ -60,6 +60,7 @@
    #include <unistd.h>
    #include <vis.h>
    #include <sys/syslog.h>
    +#include <time.h>

    static struct nlist nl[] =3D {
    #define X_MSGBUF 0
    @@ -76,18 +77,23 @@
    main(int argc, char *argv[])
    {
    struct msgbuf *bufp, cur;
    + struct timeval boottime;
    + char timebuf[64];


    Why 64?


    char *bp, *ep, *memf, *nextp, *nlistf, *p, *q, *visbp;
    + const char *timefmt =3D "%d %b %T";
    kvm_t *kd;
    + time_t time;
    size_t buflen, bufpos;
    long pri;
    - int ch, clear;
    + int ch, clear, timeconv;


    timeconv should be a bool.


    bool all;

    all =3D false;
    clear =3D false;
    + timeconv =3D false;
    (void) setlocale(LC_CTYPE, "");
    memf =3D nlistf =3D NULL;
    - while ((ch =3D getopt(argc, argv, "acM:N:")) !=3D -1)
    + while ((ch =3D getopt(argc, argv, "actf:M:N:")) !=3D -1)
    switch(ch) {
    case 'a':
    all =3D true;
    @@ -95,6 +101,12 @@
    case 'c':
    clear =3D true;
    break;
    + case 't':
    + timeconv =3D true;
    + break;
    + case 'f':
    + timefmt =3D optarg;
    + break;
    case 'M':
    memf =3D optarg;
    break;
    @@ -109,6 +121,13 @@
    if (argc !=3D 0)
    usage();

    + if( timeconv ) {


    So the spacing doesn't meet style(9). "if (timeconv) {" is the preferred spacing.


    + int mib[6] =3D { CTL_KERN, KERN_BOOTTIME };
    + size_t l =3D sizeof boottime;


    sizeof(boottime) is the preferred spelling here.


    + if (sysctl(mib, 2, &boottime, &l, 0, 0) < 0)
    + err(1, "sysctl kern.boottime");
    + }
    +
    if (memf =3D=3D NULL) {
    /*
    * Running kernel. Use sysctl. This gives an unwrapped buffer
    @@ -200,7 +219,22 @@
    }

    (void)strvisx(visbp, p, nextp - p, 0);
    - (void)printf("%s", visbp);
    + bufpos =3D strspn( visbp+1, "0123456789" ) + 1;


    No check for overflow here. *bufpos may point to a NUL and +1 will point
    it past that NULL.
    It shouldn't, but it might. And you should do something more like

    if (!timeconv) {
    <the existing printf>;
    } else {
    decode the buffer
    }

    But you should check things in the right order so you can't overflow. Your
    code already has a fallback for printing things...

    *ALSO* The parsing is wrong. When show_timestamp=3D2 it will have a
    fractional part (so .xxxx) that should be parsed as well. This also throws
    off the math that just adds to the second of time timeval.


    + if( timeconv !=3D true
    + || bufpos < 2
    + || visbp[0] !=3D '['
    + || visbp[bufpos] !=3D ']'
    + || visbp[bufpos+1] !=3D ' ' ) {
    + (void)printf("%s", visbp);
    + continue;
    + }
    +
    + visbp[bufpos] =3D '\0';
    + time =3D boottime.tv_sec + strtoull( visbp+1, NULL, 10 );
    + if( strftime( timebuf, sizeof timebuf, timefmt, localtime=
    (
    &time ) ) !=3D 0 )


    Same spacing. comment about parens. And note that we're strongly
    encouraging {} even for single line statements.


    + (void)printf( "[%s]%s", timebuf, visbp + bufpos +
    1 );
    + else
    + (void)printf("%s", visbp);
    }
    exit(0);
    }
    @@ -208,6 +242,6 @@
    void
    usage(void)
    {
    - fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n");
    + fprintf(stderr, "usage: dmesg [-ac] [-t [-f output_fmt]] [-M core
    [-N system]]\n");
    exit(1);
    }


    So that's my feedback on the first round of patches. You should do a github pull request
    or a Phabricator review. Do not put this in a bugzilla bug. Bugzilla is not
    a code review tool
    and I suspect that feedback on the revision will be needed (if nothing else than for the man
    page that we've not seen yet). github is likely easiest for you, and I'll
    keep an eye out there.
    Phabricator is a lot more work to get started. If you are going to do a
    bunch of reviews, it
    may make sense to climb the hill (or for other parts of the code whose maintainers don't do
    github). If it's just this one, and you have a github account, I'd
    recommend that as the path
    of least resistance. github also has the advantage that it will give a mini-review on style as
    well as making sure that the authorship is right.

    Warner



    -Andre



    --000000000000f2a18e0648fbbbfc
    Content-Type: text/html; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g= mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jan 22,=
    2026 at 1:46=E2=80=AFAM Andre Albsmeier &lt;<a href=3D"mailto:mail@fbsd2.e= 4m.org">mail@fbsd2.e4m.org</a>&gt; wrote:<br></div><blockquote class=3D"gma= il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2= 04,204);padding-left:1ex">On Fri, 19-Dec-2025 at 20:37:41 +0000, Jamie Land= eg-Jones wrote:<br>
    &gt; void &lt;<a href=3D"mailto:void@f-m.fm" target=3D"_blank">void@f-m.fm<= /a>&gt; wrote:<br>
    &gt; <br>
    &gt; &gt;...<br>
    &gt; &gt; and so dmsg has things like<br>
    &gt; &gt;<br>
    &gt; &gt; [1353919] swp_pager_getswapspace(32): failed<br>
    &gt; &gt;<br>
    &gt; &gt; the [1353919] I guess being the timestamp.<br>
    &gt; &gt;<br>
    &gt; &gt; ...<br>
    &gt; &gt;<br>
    &gt; Yes! You can get the value from sysctl kern.boottime.<br>
    &gt; <br>
    &gt; Here is a small program I wrote a while back, just call it<br>
    &gt; as a dmesg substitute.<br>
    &gt; ...<br>
    &gt; Cheers, Jamie<br>
    &gt; <br>
    &gt; #!/bin/sh -efu<br>
    &gt; set -efu<br>
    &gt; <br>
    &gt; boottime=3D&quot;$(/sbin/sysctl -n kern.boottime | /usr/local/bin/gawk=
    &#39;{printf &quot;%d&quot;, gensub (&quot;^.* sec =3D ([1-9][0-9]*), .*$&= quot;, &quot;\\1&quot;, 1)}&#39;)&quot;<br>
    &gt; <br>
    &gt; [ -z &quot;$(printf &#39;%s&#39; &quot;$boottime&quot; | /usr/bin/egre=
    p &#39;^0$|^[1-9][0-9]*$&#39;)&quot; ] &amp;&amp; { printf &#39;Invalid boo= ttime retrieved.\n&#39; &gt;&amp; 2; exit 1; }<br>
    &gt; <br>
    &gt; /sbin/dmesg &quot;$@&quot; | /usr/local/bin/gawk -v boottime=3D&quot;$= boottime&quot; &#39;<br>
    &gt; <br>
    &gt;=C2=A0 =C2=A0 =C2=A0{<br>
    &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0uptime =3D gensub (&quot;^\\[([1-9][0-9]*)\\=
    ] .*$&quot;, &quot;\\1&quot;, 1)<br>
    &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (uptime =3D=3D $0) realtime =3D &quot;???=
    ?? ??:??;??&quot;<br>
    &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 else realtime =3D strftime (&quot;%b %d %T&= quot;, uptime + boottime)<br>
    &gt; <br>
    &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0print realtime &quot; &quot; $0<br>
    &gt;=C2=A0 =C2=A0 =C2=A0}&#39;<br>

    FWIW, this is a patch for dmesg(1) I use. You can enable timestamp<br> conversion using -t and optionally specify a different output format<br>
    using -f &quot;fmt&quot;.<br>

    If interested for inclusion in base, I could try to re-format it<br>
    and come up with a manpage diff...<br></blockquote><div><br></div><div>Yes.=
    I&#39;ve done a quick review inline.</div><div>=C2=A0</div><blockquote cla= ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid = rgb(204,204,204);padding-left:1ex">
    --- sbin/dmesg/dmesg.c=C2=A0 2023-12-27 17:49:57.000000000 +0100<br>
    +++ sbin/dmesg/dmesg.c=C2=A0 2026-01-22 09:20:28.987020000 +0100<br>
    @@ -60,6 +60,7 @@<br>
    =C2=A0#include &lt;unistd.h&gt;<br>
    =C2=A0#include &lt;vis.h&gt;<br>
    =C2=A0#include &lt;sys/syslog.h&gt;<br>
    +#include &lt;time.h&gt;<br>

    =C2=A0static struct nlist nl[] =3D {<br>
    =C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 X_MSGBUF=C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 0<br>
    @@ -76,18 +77,23 @@<br>
    =C2=A0main(int argc, char *argv[])<br>
    =C2=A0{<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct msgbuf *bufp, cur;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0struct timeval boottime;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0char timebuf[64];<br></blockquote><div><br></di= v><div>Why 64?</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" styl= e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin= g-left:1ex">
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 char *bp, *ep, *memf, *nextp, *nlistf, *p, *q, = *visbp;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0const char *timefmt =3D &quot;%d %b %T&quot;;<b=

    =C2=A0 =C2=A0 =C2=A0 =C2=A0 kvm_t *kd;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0time_t time;<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 size_t buflen, bufpos;<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 long pri;<br>
    -=C2=A0 =C2=A0 =C2=A0 =C2=A0int ch, clear;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0int ch, clear, timeconv;<br></blockquote><div><= br></div><div>timeconv should=C2=A0be a bool.</div><div>=C2=A0</div><blockq= uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
    x solid rgb(204,204,204);padding-left:1ex">
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 bool all;<br>

    =C2=A0 =C2=A0 =C2=A0 =C2=A0 all =3D false;<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 clear =3D false;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0timeconv =3D false;<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 (void) setlocale(LC_CTYPE, &quot;&quot;);<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 memf =3D nlistf =3D NULL;<br>
    -=C2=A0 =C2=A0 =C2=A0 =C2=A0while ((ch =3D getopt(argc, argv, &quot;acM:N:&= quot;)) !=3D -1)<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0while ((ch =3D getopt(argc, argv, &quot;actf:M:= N:&quot;)) !=3D -1)<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 switch(ch) {<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case &#39;a&#39;:<b=

    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 all =3D true;<br>
    @@ -95,6 +101,12 @@<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case &#39;c&#39;:<b=

    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 clear =3D true;<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 break;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case &#39;t&#39;:<b=

    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0timeconv =3D true;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0break;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case &#39;f&#39;:<b=

    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0timefmt =3D optarg;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0break;<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case &#39;M&#39;:<b=

    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 memf =3D optarg;<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 break;<br>
    @@ -109,6 +121,13 @@<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (argc !=3D 0)<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 usage();<br>

    +=C2=A0 =C2=A0 =C2=A0 =C2=A0if( timeconv ) {<br></blockquote><div><br></div= ><div>So the spacing doesn&#39;t meet style(9). &quot;if (timeconv) {&quot;=
    is the preferred spacing.</div><div>=C2=A0</div><blockquote class=3D"gmail= _quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204= ,204);padding-left:1ex">
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int mib[6] =3D { CT= L_KERN, KERN_BOOTTIME };<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0size_t l =3D sizeof=
    boottime;<br></blockquote><div><br></div><div>sizeof(boottime) is the pref= erred spelling here.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote=
    " style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);= padding-left:1ex">
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (sysctl(mib, 2, = &amp;boottime, &amp;l, 0, 0) &lt; 0)<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0err(1, &quot;sysctl kern.boottime&quot;);<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
    +<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (memf =3D=3D NULL) {<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* Running ker= nel.=C2=A0 Use sysctl.=C2=A0 This gives an unwrapped buffer<br>
    @@ -200,7 +219,22 @@<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>

    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (void)strvisx(visbp=
    , p, nextp - p, 0);<br>
    -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(void)printf(&quot;= %s&quot;, visbp);<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bufpos =3D strspn( = visbp+1, &quot;0123456789&quot; ) + 1;<br></blockquote><div><br></div><div>=
    No check for overflow here.=C2=A0 *bufpos may point to a NUL and=C2=A0+1 wi=
    ll point it past that NULL.</div><div>It shouldn&#39;t, but it might. And y=
    ou should do something more like</div><div><br></div><div>if (!timeconv) {<= /div><div>&lt;the existing printf&gt;;</div><div>} else {</div><div>decode = the buffer</div><div>}</div><div><br></div><div>But you should check things=
    in the right order so you can&#39;t overflow. Your code already has a fall= back for printing things...</div><div><br></div><div>*ALSO* The parsing is = wrong. When show_timestamp=3D2 it will have a fractional part (so .xxxx) th=
    at should be parsed as well. This also throws off the math that just adds t=
    o the second of time timeval.</div><div>=C2=A0</div><blockquote class=3D"gm= ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,= 204,204);padding-left:1ex">
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if( timeconv !=3D t= rue<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || bufpos &lt; 2<b=

    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || visbp[0] !=3D &= #39;[&#39;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || visbp[bufpos] != =3D &#39;]&#39;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || visbp[bufpos+1]=
    !=3D &#39; &#39; ) {<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0(void)printf(&quot;%s&quot;, visbp);<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0continue;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
    +<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0visbp[bufpos] =3D &= #39;\0&#39;;<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0time =3D boottime.t= v_sec + strtoull( visbp+1, NULL, 10 );<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if( strftime( timeb= uf, sizeof timebuf, timefmt, localtime( &amp;time ) ) !=3D 0 )<br></blockqu= ote><div><br></div><div>Same spacing. comment about parens. And note that w= e&#39;re strongly encouraging {} even for single line statements.</div><div= >=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px = 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0(void)printf( &quot;[%s]%s&quot;, timebuf, visbp + bufpos + 1 );<=

    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0(void)printf(&quot;%s&quot;, visbp);<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit(0);<br>
    =C2=A0}<br>
    @@ -208,6 +242,6 @@<br>
    =C2=A0void<br>
    =C2=A0usage(void)<br>
    =C2=A0{<br>
    -=C2=A0 =C2=A0 =C2=A0 =C2=A0fprintf(stderr, &quot;usage: dmesg [-ac] [-M co=
    re [-N system]]\n&quot;);<br>
    +=C2=A0 =C2=A0 =C2=A0 =C2=A0fprintf(stderr, &quot;usage: dmesg [-ac] [-t [-=
    f output_fmt]] [-M core [-N system]]\n&quot;);<br>
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit(1);<br> =C2=A0}<br></blockquote><div><br></div><div>So that&#39;s my feedback on th=
    e first round of patches. You should do a github pull request=C2=A0</div><d= iv>or a Phabricator review. Do not put this in a bugzilla bug. Bugzilla is = not a code review tool</div><div>and I suspect that feedback on the revisio=
    n will be needed (if nothing else than for the man</div><div>page that we&#= 39;ve not seen yet). github is likely easiest for you, and I&#39;ll keep an=
    eye out there.</div><div>Phabricator is a lot more work to get started. If=
    you are going to do a bunch of reviews, it</div><div>may make sense to cli=
    mb the hill (or for other parts of the code whose maintainers don&#39;t do<= /div><div>github). If it&#39;s just this one, and you have a github account=
    , I&#39;d recommend that as the path</div><div>of least resistance. github = also has the advantage that it will give a mini-review on style as</div><di= v>well as making sure that the authorship is right.</div><div><br></div><di= v>Warner</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"m= argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left= :1ex">

    =C2=A0 =C2=A0 =C2=A0 =C2=A0 -Andre<br>

    </blockquote></div></div>

    --000000000000f2a18e0648fbbbfc--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jamie Landeg-Jones@jamie@catflap.org to muc.lists.freebsd.stable on Fri Jan 23 04:12:30 2026
    From Newsgroup: muc.lists.freebsd.stable

    Andre Albsmeier <mail@fbsd2.e4m.org> wrote:

    FWIW, this is a patch for dmesg(1) I use. You can enable timestamp
    conversion using -t and optionally specify a different output format
    using -f "fmt".

    If interested for inclusion in base, I could try to re-format it
    and come up with a manpage diff...

    I'vw been meaning to do that for some time, so cool, now I don't have to :-)

    I am not able to test the patch at the moment, but I looked at the patch itself, and I like it. I like how you replace the numerical uptime with
    the date/time (that's what I was planning on doing), but the addition of
    the time formatting option is a nice touch I hadn't thought of doing!

    I think this would make a nice addition to base dmesg, and I think
    Warner was talking about getting proper datestamps in dmesg output a
    while ago (though I'm not sure whether he meant at the dmesg presentation
    side, or a sysctl to place the timestamp in the kernel-buffer messsage itself)

    Hopefully I haven't got this wrong, and he can elaborate.

    Cheers, Jamie


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Warner Losh@imp@bsdimp.com to muc.lists.freebsd.stable on Fri Jan 23 06:33:50 2026
    From Newsgroup: muc.lists.freebsd.stable

    --000000000000d6140b06490e3599
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    On Fri, Jan 23, 2026 at 2:21=E2=80=AFAM Tomoaki AOKI <junchoon@dec.sakura.n= e.jp>
    wrote:

    On Fri, 23 Jan 2026 09:40:17 +0100
    Andre Albsmeier <mail@fbsd2.e4m.org> wrote:

    On Thu, 22-Jan-2026 at 08:31:15 -0700, Warner Losh wrote:
    On Thu, Jan 22, 2026 at 1:46=E2=80=AFAM Andre Albsmeier <mail@fbsd2.e=
    4m.org>
    wrote:

    On Fri, 19-Dec-2025 at 20:37:41 +0000, Jamie Landeg-Jones wrote:
    void <void@f-m.fm> wrote:

    ...
    and so dmsg has things like

    [1353919] swp_pager_getswapspace(32): failed

    the [1353919] I guess being the timestamp.

    ...

    Yes! You can get the value from sysctl kern.boottime.

    Here is a small program I wrote a while back, just call it
    as a dmesg substitute.
    ...
    Cheers, Jamie

    #!/bin/sh -efu
    set -efu

    boottime=3D"$(/sbin/sysctl -n kern.boottime | /usr/local/bin/gawk
    '{printf
    "%d", gensub ("^.* sec =3D ([1-9][0-9]*), .*$", "\\1", 1)}')"

    [ -z "$(printf '%s' "$boottime" | /usr/bin/egrep
    '^0$|^[1-9][0-9]*$')" ]
    && { printf 'Invalid boottime retrieved.\n' >& 2; exit 1; }

    /sbin/dmesg "$@" | /usr/local/bin/gawk -v boottime=3D"$boottime" =
    '

    {
    uptime =3D gensub ("^\\[([1-9][0-9]*)\\] .*$", "\\1", 1)
    if (uptime =3D=3D $0) realtime =3D "??? ?? ??:??;??"
    else realtime =3D strftime ("%b %d %T", uptime + boottime)

    print realtime " " $0
    }'

    FWIW, this is a patch for dmesg(1) I use. You can enable timestamp conversion using -t and optionally specify a different output forma=
    t
    using -f "fmt".

    If interested for inclusion in base, I could try to re-format it
    and come up with a manpage diff...


    Yes. I've done a quick review inline.

    Thanks...

    --- sbin/dmesg/dmesg.c 2023-12-27 17:49:57.000000000 +0100
    +++ sbin/dmesg/dmesg.c 2026-01-22 09:20:28.987020000 +0100
    @@ -60,6 +60,7 @@
    #include <unistd.h>
    #include <vis.h>
    #include <sys/syslog.h>
    +#include <time.h>

    static struct nlist nl[] =3D {
    #define X_MSGBUF 0
    @@ -76,18 +77,23 @@
    main(int argc, char *argv[])
    {
    struct msgbuf *bufp, cur;
    + struct timeval boottime;
    + char timebuf[64];


    Why 64?

    Well, any recommendation? Is the a _MAX define somewhere?
    I always use 64 but if there is something better I'll use it.



    char *bp, *ep, *memf, *nextp, *nlistf, *p, *q, *visbp;
    + const char *timefmt =3D "%d %b %T";
    kvm_t *kd;
    + time_t time;
    size_t buflen, bufpos;
    long pri;
    - int ch, clear;
    + int ch, clear, timeconv;


    timeconv should be a bool.

    OK...



    bool all;

    all =3D false;
    clear =3D false;
    + timeconv =3D false;
    (void) setlocale(LC_CTYPE, "");
    memf =3D nlistf =3D NULL;
    - while ((ch =3D getopt(argc, argv, "acM:N:")) !=3D -1)
    + while ((ch =3D getopt(argc, argv, "actf:M:N:")) !=3D -1)
    switch(ch) {
    case 'a':
    all =3D true;
    @@ -95,6 +101,12 @@
    case 'c':
    clear =3D true;
    break;
    + case 't':
    + timeconv =3D true;
    + break;
    + case 'f':
    + timefmt =3D optarg;
    + break;
    case 'M':
    memf =3D optarg;
    break;
    @@ -109,6 +121,13 @@
    if (argc !=3D 0)
    usage();

    + if( timeconv ) {


    So the spacing doesn't meet style(9). "if (timeconv) {" is the
    preferred
    spacing.

    Yes, that's why I offered to re-format it...



    + int mib[6] =3D { CTL_KERN, KERN_BOOTTIME };
    + size_t l =3D sizeof boottime;


    sizeof(boottime) is the preferred spelling here.


    + if (sysctl(mib, 2, &boottime, &l, 0, 0) < 0)
    + err(1, "sysctl kern.boottime");
    + }
    +
    if (memf =3D=3D NULL) {
    /*
    * Running kernel. Use sysctl. This gives an
    unwrapped
    buffer
    @@ -200,7 +219,22 @@
    }

    (void)strvisx(visbp, p, nextp - p, 0);
    - (void)printf("%s", visbp);
    + bufpos =3D strspn( visbp+1, "0123456789" ) + 1;


    No check for overflow here. *bufpos may point to a NUL and +1 will
    point
    it past that NULL.

    bufpos is no pointer but size_t. visbp[ bufpos ] will never point past
    '\0' as I start at visbp + 1 for the strspn().

    But the test of visbp[ bufpos+1 ] below is not OK. I'll fix that...

    It shouldn't, but it might. And you should do something more like

    if (!timeconv) {
    <the existing printf>;
    } else {
    decode the buffer
    }

    I din't want to duplicate <the existing printf> too often in case
    timeconv is desired but fails later for whatever reasons. So would
    is the recommendation here?

    1. Whenever it fails, do <the existing printf> and continue?

    2. Place <the existing printf> at the end and "goto" it?

    3. ??


    But you should check things in the right order so you can't overflow.
    Your
    code already has a fallback for printing things...

    *ALSO* The parsing is wrong. When show_timestamp=3D2 it will have a fractional part (so .xxxx) that should be parsed as well. This also
    throws
    off the math that just adds to the second of time timeval.

    Right, the conversion gets aborted in this case (I never used show_timestamp=3D2 ;-)). I'll have a look at it...


    + if( timeconv !=3D true
    + || bufpos < 2
    + || visbp[0] !=3D '['
    + || visbp[bufpos] !=3D ']'
    + || visbp[bufpos+1] !=3D ' ' ) {
    + (void)printf("%s", visbp);
    + continue;
    + }
    +
    + visbp[bufpos] =3D '\0';
    + time =3D boottime.tv_sec + strtoull( visbp+1, NULL,=
    10
    );
    + if( strftime( timebuf, sizeof timebuf, timefmt,
    localtime(
    &time ) ) !=3D 0 )


    Same spacing. comment about parens. And note that we're strongly encouraging {} even for single line statements.

    OK...

    ...
    So that's my feedback on the first round of patches. You should do a
    github
    pull request
    or a Phabricator review. Do not put this in a bugzilla bug. Bugzilla
    is not
    a code review tool
    and I suspect that feedback on the revision will be needed (if nothin=
    g
    else
    than for the man
    page that we've not seen yet). github is likely easiest for you, and
    I'll
    keep an eye out there.
    Phabricator is a lot more work to get started. If you are going to do=
    a
    bunch of reviews, it
    may make sense to climb the hill (or for other parts of the code whos=
    e
    maintainers don't do
    github). If it's just this one, and you have a github account, I'd recommend that as the path

    I used Phabricator once (https://reviews.freebsd.org/D46313) but I thin=
    k
    I'll follow your advice and try the github way...

    -Andre

    I think opening review on Phabricator alone is easily missed.
    So I basically file a PR on Bugzilla, open review and introduce
    the D number of the review on Bugzilla PR.


    Phabricator at this point has no oversight (though there's some work
    to change that) and thousands of open PRs. It's impossible to find useful things to land or review for huge swaths of the tree.


    And pull request on GitHub alone is also easily missed for anyone
    without GitHub account like me.


    True, but they are easily found in comparison to Phabricator.


    Upcoming (hopefully) moving from GitHub to Forgejo managed by
    FreeBSD project could change the situation, but it's still
    not official. I'm thinking about how my workflow should be
    non the switch.


    So it's not a move from github. Github is there to allow us to accept more submissions in a way that has less friction and a higher likelihood of
    success
    than phabricator or bugzilla patches for new contributors to the src tree.
    It
    doesn't matter at all to the other workflows the project has setup that
    tend to
    be the main work flows. Those workflows are very hard for non-committers to use, hence the adding of github as an additional submission method.

    Moving from cgit to Forgejo is more fundamental. It moves the primary
    workflow
    of the project from a weird, bespoke, hodge-podge of tools and isolated use case
    solutions to an integrated workflow that committer and non-committer alike
    can
    access with an acceptable amount of friction.

    Warner

    --000000000000d6140b06490e3599
    Content-Type: text/html; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g= mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jan 23,=
    2026 at 2:21=E2=80=AFAM Tomoaki AOKI &lt;<a href=3D"mailto:junchoon@dec.sa= kura.ne.jp">junchoon@dec.sakura.ne.jp</a>&gt; wrote:<br></div><blockquote c= lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
    d rgb(204,204,204);padding-left:1ex">On Fri, 23 Jan 2026 09:40:17 +0100<br> Andre Albsmeier &lt;<a href=3D"mailto:mail@fbsd2.e4m.org" target=3D"_blank"= >mail@fbsd2.e4m.org</a>&gt; wrote:<br>

    &gt; On Thu, 22-Jan-2026 at 08:31:15 -0700, Warner Losh wrote:<br>
    &gt; &gt; On Thu, Jan 22, 2026 at 1:46=E2=80=AFAM Andre Albsmeier &lt;<a hr= ef=3D"mailto:mail@fbsd2.e4m.org" target=3D"_blank">mail@fbsd2.e4m.org</a>&g=
    t; wrote:<br>
    &gt; &gt; <br>
    &gt; &gt; &gt; On Fri, 19-Dec-2025 at 20:37:41 +0000, Jamie Landeg-Jones wr= ote:<br>
    &gt; &gt; &gt; &gt; void &lt;<a href=3D"mailto:void@f-m.fm" target=3D"_blan= k">void@f-m.fm</a>&gt; wrote:<br>
    &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; &gt;...<br>
    &gt; &gt; &gt; &gt; &gt; and so dmsg has things like<br>
    &gt; &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; &gt; [1353919] swp_pager_getswapspace(32): failed<br>
    &gt; &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; &gt; the [1353919] I guess being the timestamp.<br>
    &gt; &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; &gt; ...<br>
    &gt; &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; Yes! You can get the value from sysctl kern.boottime.<b=

    &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; Here is a small program I wrote a while back, just call=
    it<br>
    &gt; &gt; &gt; &gt; as a dmesg substitute.<br>
    &gt; &gt; &gt; &gt; ...<br>
    &gt; &gt; &gt; &gt; Cheers, Jamie<br>
    &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; #!/bin/sh -efu<br>
    &gt; &gt; &gt; &gt; set -efu<br>
    &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; boottime=3D&quot;$(/sbin/sysctl -n kern.boottime | /usr= /local/bin/gawk &#39;{printf<br>
    &gt; &gt; &gt; &quot;%d&quot;, gensub (&quot;^.* sec =3D ([1-9][0-9]*), .*$= &quot;, &quot;\\1&quot;, 1)}&#39;)&quot;<br>
    &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; [ -z &quot;$(printf &#39;%s&#39; &quot;$boottime&quot; =
    | /usr/bin/egrep &#39;^0$|^[1-9][0-9]*$&#39;)&quot; ]<br>
    &gt; &gt; &gt; &amp;&amp; { printf &#39;Invalid boottime retrieved.\n&#39; = &gt;&amp; 2; exit 1; }<br>
    &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt; /sbin/dmesg &quot;$@&quot; | /usr/local/bin/gawk -v boo= ttime=3D&quot;$boottime&quot; &#39;<br>
    &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0{<br>
    &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0uptime =3D gensub (&quot;^\\[= ([1-9][0-9]*)\\] .*$&quot;, &quot;\\1&quot;, 1)<br>
    &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (uptime =3D=3D $0) realtim=
    e =3D &quot;??? ?? ??:??;??&quot;<br>
    &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 else realtime =3D strftime (= &quot;%b %d %T&quot;, uptime + boottime)<br>
    &gt; &gt; &gt; &gt;<br>
    &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0print realtime &quot; &quot; = $0<br>
    &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0}&#39;<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; &gt; FWIW, this is a patch for dmesg(1) I use. You can enable tim= estamp<br>
    &gt; &gt; &gt; conversion using -t and optionally specify a different outpu=
    t format<br>
    &gt; &gt; &gt; using -f &quot;fmt&quot;.<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; &gt; If interested for inclusion in base, I could try to re-forma=
    t it<br>
    &gt; &gt; &gt; and come up with a manpage diff...<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; <br>
    &gt; &gt; Yes. I&#39;ve done a quick review inline.<br>
    &gt; <br>
    &gt; Thanks...<br>
    &gt; <br>
    &gt; &gt; &gt; --- sbin/dmesg/dmesg.c=C2=A0 2023-12-27 17:49:57.000000000 += 0100<br>
    &gt; &gt; &gt; +++ sbin/dmesg/dmesg.c=C2=A0 2026-01-22 09:20:28.987020000 += 0100<br>
    &gt; &gt; &gt; @@ -60,6 +60,7 @@<br>
    &gt; &gt; &gt;=C2=A0 #include &lt;unistd.h&gt;<br>
    &gt; &gt; &gt;=C2=A0 #include &lt;vis.h&gt;<br>
    &gt; &gt; &gt;=C2=A0 #include &lt;sys/syslog.h&gt;<br>
    &gt; &gt; &gt; +#include &lt;time.h&gt;<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; &gt;=C2=A0 static struct nlist nl[] =3D {<br>
    &gt; &gt; &gt;=C2=A0 #define=C2=A0 =C2=A0 =C2=A0 =C2=A0 X_MSGBUF=C2=A0 =C2=
    =A0 =C2=A0 =C2=A0 0<br>
    &gt; &gt; &gt; @@ -76,18 +77,23 @@<br>
    &gt; &gt; &gt;=C2=A0 main(int argc, char *argv[])<br>
    &gt; &gt; &gt;=C2=A0 {<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct msgbuf *bufp, cur;<b=

    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0struct timeval boottime;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0char timebuf[64];<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; <br>
    &gt; &gt; Why 64?<br>
    &gt; <br>
    &gt; Well, any recommendation? Is the a _MAX define somewhere?<br>
    &gt; I always use 64 but if there is something better I&#39;ll use it.<br>
    &gt; <br>
    &gt; &gt; <br>
    &gt; &gt; <br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0char *bp, *ep, *memf, *next=
    p, *nlistf, *p, *q, *visbp;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0const char *timefmt =3D &quot;%d=
    %b %T&quot;;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0kvm_t *kd;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0time_t time;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0size_t buflen, bufpos;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0long pri;<br>
    &gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0int ch, clear;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0int ch, clear, timeconv;<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; <br>
    &gt; &gt; timeconv should be a bool.<br>
    &gt; <br>
    &gt; OK...<br>
    &gt; <br>
    &gt; &gt; <br>
    &gt; &gt; <br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bool all;<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0all =3D false;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0clear =3D false;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0timeconv =3D false;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(void) setlocale(LC_CTYPE, = &quot;&quot;);<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0memf =3D nlistf =3D NULL;<b=

    &gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0while ((ch =3D getopt(argc, argv=
    , &quot;acM:N:&quot;)) !=3D -1)<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0while ((ch =3D getopt(argc, argv=
    , &quot;actf:M:N:&quot;)) !=3D -1)<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0switch(ch) {<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0case &#39;a&#39;:<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0all =3D true;<br>
    &gt; &gt; &gt; @@ -95,6 +101,12 @@<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0case &#39;c&#39;:<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0clear =3D true;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case=
    &#39;t&#39;:<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0timeconv =3D true;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0break;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case=
    &#39;f&#39;:<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0timefmt =3D optarg;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0break;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0case &#39;M&#39;:<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0memf =3D optarg;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;<br>
    &gt; &gt; &gt; @@ -109,6 +121,13 @@<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (argc !=3D 0)<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0usage();<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0if( timeconv ) {<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; <br>
    &gt; &gt; So the spacing doesn&#39;t meet style(9). &quot;if (timeconv) {&q= uot; is the preferred<br>
    &gt; &gt; spacing.<br>
    &gt; <br>
    &gt; Yes, that&#39;s why I offered to re-format it...<br>
    &gt; <br>
    &gt; &gt; <br>
    &gt; &gt; <br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int = mib[6] =3D { CTL_KERN, KERN_BOOTTIME };<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0size=
    _t l =3D sizeof boottime;<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; <br>
    &gt; &gt; sizeof(boottime) is the preferred spelling here.<br>
    &gt; &gt; <br>
    &gt; &gt; <br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (= sysctl(mib, 2, &amp;boottime, &amp;l, 0, 0) &lt; 0)<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0err(1, &quot;sysctl kern.boottime&quot;);<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
    &gt; &gt; &gt; +<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (memf =3D=3D NULL) {<br> &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0/*<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
    =A0 * Running kernel.=C2=A0 Use sysctl.=C2=A0 This gives an unwrapped<br>
    &gt; &gt; &gt; buffer<br>
    &gt; &gt; &gt; @@ -200,7 +219,22 @@<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0}<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(void)strvisx(visbp, p, nextp - p, 0);<br>
    &gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(voi= d)printf(&quot;%s&quot;, visbp);<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bufp=
    os =3D strspn( visbp+1, &quot;0123456789&quot; ) + 1;<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; <br>
    &gt; &gt; No check for overflow here.=C2=A0 *bufpos may point to a NUL and =
    +1 will point<br>
    &gt; &gt; it past that NULL.<br>
    &gt; <br>
    &gt; bufpos is no pointer but size_t. visbp[ bufpos ] will never point past=

    &gt; &#39;\0&#39; as I start at visbp + 1 for the strspn().<br>
    &gt; <br>
    &gt; But the test of visbp[ bufpos+1 ] below is not OK. I&#39;ll fix that..= .<br>
    &gt; <br>
    &gt; &gt; It shouldn&#39;t, but it might. And you should do something more = like<br>
    &gt; &gt; <br>
    &gt; &gt; if (!timeconv) {<br>
    &gt; &gt; &lt;the existing printf&gt;;<br>
    &gt; &gt; } else {<br>
    &gt; &gt; decode the buffer<br>
    &gt; &gt; }<br>
    &gt; <br>
    &gt; I din&#39;t want to duplicate &lt;the existing printf&gt; too often in=
    case<br>
    &gt; timeconv is desired but fails later for whatever reasons. So would<br> &gt; is the recommendation here?<br>
    &gt; <br>
    &gt; 1. Whenever it fails, do &lt;the existing printf&gt; and continue?<br> &gt; <br>
    &gt; 2. Place &lt;the existing printf&gt; at the end and &quot;goto&quot; i= t?<br>
    &gt; <br>
    &gt; 3. ??<br>
    &gt; <br>
    &gt; &gt; <br>
    &gt; &gt; But you should check things in the right order so you can&#39;t o= verflow. Your<br>
    &gt; &gt; code already has a fallback for printing things...<br>
    &gt; &gt; <br>
    &gt; &gt; *ALSO* The parsing is wrong. When show_timestamp=3D2 it will have=
    a<br>
    &gt; &gt; fractional part (so .xxxx) that should be parsed as well. This al=
    so throws<br>
    &gt; &gt; off the math that just adds to the second of time timeval.<br>
    &gt; <br>
    &gt; Right, the conversion gets aborted in this case (I never used<br>
    &gt; show_timestamp=3D2 ;-)). I&#39;ll have a look at it...<br>
    &gt; <br>
    &gt; &gt; <br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if( = timeconv !=3D true<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || = bufpos &lt; 2<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || = visbp[0] !=3D &#39;[&#39;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || = visbp[bufpos] !=3D &#39;]&#39;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || = visbp[bufpos+1] !=3D &#39; &#39; ) {<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(void)printf(&quot;%s&quot;, visbp);<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0continue;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br=

    &gt; &gt; &gt; +<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0visb= p[bufpos] =3D &#39;\0&#39;;<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0time=
    =3D boottime.tv_sec + strtoull( visbp+1, NULL, 10 );<br>
    &gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if( = strftime( timebuf, sizeof timebuf, timefmt, localtime(<br>
    &gt; &gt; &gt; &amp;time ) ) !=3D 0 )<br>
    &gt; &gt; &gt;<br>
    &gt; &gt; <br>
    &gt; &gt; Same spacing. comment about parens. And note that we&#39;re stron= gly<br>
    &gt; &gt; encouraging {} even for single line statements.<br>
    &gt; <br>
    &gt; OK...<br>
    &gt; <br>
    &gt; &gt; ...<br>
    &gt; &gt; So that&#39;s my feedback on the first round of patches. You shou=
    ld do a github<br>
    &gt; &gt; pull request<br>
    &gt; &gt; or a Phabricator review. Do not put this in a bugzilla bug. Bugzi= lla is not<br>
    &gt; &gt; a code review tool<br>
    &gt; &gt; and I suspect that feedback on the revision will be needed (if no= thing else<br>
    &gt; &gt; than for the man<br>
    &gt; &gt; page that we&#39;ve not seen yet). github is likely easiest for y= ou, and I&#39;ll<br>
    &gt; &gt; keep an eye out there.<br>
    &gt; &gt; Phabricator is a lot more work to get started. If you are going t=
    o do a<br>
    &gt; &gt; bunch of reviews, it<br>
    &gt; &gt; may make sense to climb the hill (or for other parts of the code = whose<br>
    &gt; &gt; maintainers don&#39;t do<br>
    &gt; &gt; github). If it&#39;s just this one, and you have a github account=
    , I&#39;d<br>
    &gt; &gt; recommend that as the path<br>
    &gt; <br>
    &gt; I used Phabricator once (<a href=3D"https://reviews.freebsd.org/D46313=
    " rel=3D"noreferrer" target=3D"_blank">https://reviews.freebsd.org/D46313</= a>) but I think<br>
    &gt; I&#39;ll follow your advice and try the github way...<br>
    &gt; <br>
    &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0-Andre<br>

    I think opening review on Phabricator alone is easily missed.<br>
    So I basically file a PR on Bugzilla, open review and introduce<br>
    the D number of the review on Bugzilla PR.<br></blockquote><div><br></div><= div>Phabricator at this point has no oversight (though there&#39;s some wor= k</div><div>to change that) and thousands of open PRs. It&#39;s impossible =
    to find useful</div><div>things to land or review for huge swaths of the tr= ee.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin= :0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=

    And pull request on GitHub alone is also easily missed for anyone<br>
    without GitHub account like me.<br></blockquote><div><br></div><div>True, b=
    ut they are easily found in comparison to Phabricator.</div><div>=C2=A0</di= v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde= r-left:1px solid rgb(204,204,204);padding-left:1ex">
    Upcoming (hopefully) moving from GitHub to Forgejo managed by<br>
    FreeBSD project could change the situation, but it&#39;s still<br>
    not official. I&#39;m thinking about how my workflow should be<br>non the s= witch.<br></blockquote><div><br></div><div>So it&#39;s not a move from gith= ub. Github is there to allow us to accept more</div><div>submissions in a w=
    ay that has less friction and a higher likelihood of success</div><div>than=
    phabricator or bugzilla patches for new contributors=C2=A0to the src tree.=
    It</div><div>doesn&#39;t matter at all to the other workflows the project = has setup that tend to</div><div>be the main work flows. Those workflows ar=
    e very hard for non-committers to</div><div>use, hence the adding of github=
    as an additional submission method.</div><div><br></div><div>Moving from c= git to Forgejo is more fundamental. It moves the primary workflow</div><div= >of the project from a weird, bespoke, hodge-podge of tools and isolated us=
    e case</div><div>solutions to an integrated workflow that committer and non= -committer alike can</div><div>access with an acceptable amount of friction= .</div><div><br></div><div>Warner</div><div><br></div></div></div>

    --000000000000d6140b06490e3599--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mark Linimon@linimon@portsmon.org to muc.lists.freebsd.stable on Fri Jan 23 08:16:52 2026
    From Newsgroup: muc.lists.freebsd.stable

    On 01/23/2026 3:21 AM CST Tomoaki AOKI <junchoon@dec.sakura.ne.jp> wrote:
    I think opening review on Phabricator alone is easily missed.
    So I basically file a PR on Bugzilla, open review and introduce
    the D number of the review on Bugzilla PR.

    IMHO the fact that we make our developers jump through these hoops
    is proof our tooling is wrong.

    Other than duplicating work, he biggest problem with the workflow
    above is that Someone (TM) needs to go through the Problem Reports
    looking for references to completed DR.

    I do it once every few months but it's low-reward work.

    mcl


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Warner Losh@imp@bsdimp.com to muc.lists.freebsd.stable on Fri Jan 23 07:29:31 2026
    From Newsgroup: muc.lists.freebsd.stable

    --000000000000f9effb06490efc82
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    On Fri, Jan 23, 2026 at 7:16=E2=80=AFAM Mark Linimon <linimon@portsmon.org>=
    wrote:

    On 01/23/2026 3:21 AM CST Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
    wrote:
    I think opening review on Phabricator alone is easily missed.
    So I basically file a PR on Bugzilla, open review and introduce
    the D number of the review on Bugzilla PR.

    IMHO the fact that we make our developers jump through these hoops
    is proof our tooling is wrong.


    Yes. 100% agreed. It's the tooling we have. It's not the tooling we want.
    there are too many hoops.


    Other than duplicating work, he biggest problem with the workflow
    above is that Someone (TM) needs to go through the Problem Reports
    looking for references to completed DR.


    Yes. Also a flaw. It's also why we need to strongly say 'do not duplicate' because
    It causes nothing but extra work for us and has limited value.

    Warner

    --000000000000f9effb06490efc82
    Content-Type: text/html; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g= mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jan 23,=
    2026 at 7:16=E2=80=AFAM Mark Linimon &lt;<a href=3D"mailto:linimon@portsmo= n.org">linimon@portsmon.org</a>&gt; wrote:<br></div><blockquote class=3D"gm= ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,= 204,204);padding-left:1ex">&gt; On 01/23/2026 3:21 AM CST Tomoaki AOKI &lt;=
    <a href=3D"mailto:junchoon@dec.sakura.ne.jp" target=3D"_blank">junchoon@dec= .sakura.ne.jp</a>&gt; wrote:<br>
    &gt; I think opening review on Phabricator alone is easily missed.<br>
    &gt; So I basically file a PR on Bugzilla, open review and introduce<br>
    &gt; the D number of the review on Bugzilla PR.<br>

    IMHO the fact that we make our developers jump through these hoops<br>
    is proof our tooling is wrong.<br></blockquote><div><br></div><div>Yes. 100=
    % agreed. It&#39;s the tooling we have. It&#39;s not the tooling we want. t= here are too many hoops.</div><div>=C2=A0</div><blockquote class=3D"gmail_q= uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2= 04);padding-left:1ex">
    Other than duplicating work, he biggest problem with the workflow<br>
    above is that Someone (TM) needs to go through the Problem Reports<br>
    looking for references to completed DR.</blockquote><div><br></div><div>Yes=
    . Also a flaw. It&#39;s also why we need to strongly say &#39;do not duplic= ate&#39; because</div><div>It causes nothing but extra work for us and has = limited value.</div><div><br></div><div>Warner</div></div></div>

    --000000000000f9effb06490efc82--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mark Linimon@linimon@portsmon.org to muc.lists.freebsd.stable on Sun Jan 25 11:28:15 2026
    From Newsgroup: muc.lists.freebsd.stable

    On 01/25/2026 1:57 AM CST Tomoaki AOKI <junchoon@dec.sakura.ne.jp> wrote:

    BTW, the account I've registered at Forgejo repo seems to be deleted.

    If you are talking about the FreeBSD forgejo instance, IIUC it
    is a test instance and not meant for actual users yet.

    mcl


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Tomoaki AOKI@junchoon@dec.sakura.ne.jp to muc.lists.freebsd.stable on Mon Jan 26 07:26:02 2026
    From Newsgroup: muc.lists.freebsd.stable

    On Sun, 25 Jan 2026 11:28:15 -0600 (CST)
    Mark Linimon <linimon@portsmon.org> wrote:

    On 01/25/2026 1:57 AM CST Tomoaki AOKI <junchoon@dec.sakura.ne.jp> wrote:

    BTW, the account I've registered at Forgejo repo seems to be deleted.

    If you are talking about the FreeBSD forgejo instance, IIUC it
    is a test instance and not meant for actual users yet.

    mcl

    OK, Thanks!
    I'll wait for official instance (Forgejo or else?) to be available
    and register again.

    Regards.
    --
    Tomoaki AOKI <junchoon@dec.sakura.ne.jp>


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Anton Shepelev@anton.txt@gmail.com to muc.lists.freebsd.stable on Tue Feb 3 18:22:35 2026
    From Newsgroup: muc.lists.freebsd.stable

    void:

    In /etc/sysctl.conf I have

    kern.msgbuf_show_timestamp=1

    and so dmsg has things like

    [1353919] swp_pager_getswapspace(32): failed

    the [1353919] I guess being the timestamp.

    But what is it?

    Seconds since boot?

    If it's that, then where can the true boot time be
    found?

    Try `dmesg -T'.



    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21b-Linux NewsLink 1.2