• Bug#408879: Bug is still present! Re: Bug#408879 closed by Craig (ps pr

    From Craig Small@21:1/5 to Paul Szabo on Tue Apr 15 13:00:01 2025
    On Tue, 15 Apr 2025 at 19:48, Paul Szabo <paul.szabo@sydney.edu.au> wrote:


    psz@azaona:~$ date --rfc-3339=ns; ps -ouser,lstart,command | grep -E 'psz.*grep|USER'
    2025-04-15 19:38:41.589754682+10:00
    USER STARTED COMMAND
    psz Tue Apr 15 19:38:40 2025 grep -E psz.*grep|USER

    Surely worth re-opening, and fixing anytime in the next 20 years?

    I've had another look at this, I've been looking at the angle from start
    time to boot time, but that might not be where the issue is.

    lstart comes from boot_time + TICS_BEGAN which is then converted to a real
    time with localtime and strftime
    boot_time comes from the btime field in /proc/stat
    TICS_BEGAN comes from field 22 of /proc/PID/stat (converted from Hz, or
    divided by 100).

    So, could btime be wrong? Or rather be correct at time of boot and then the system (once network is up and ntp is online) change its systen time?
    $ date +%s ; btime=`grep btime /proc/stat |cut -f 2 -d' '` ; utime=`cut -f
    1 -d'.' /proc/uptime` ; date +%s ; now=$((utime + btime)) ; echo $now 1744714188
    1744714188
    1744714187

    - Craig

    <div dir="ltr"><div dir="ltr">On Tue, 15 Apr 2025 at 19:48, Paul Szabo &lt;<a href="mailto:paul.szabo@sydney.edu.au">paul.szabo@sydney.edu.au</a>&gt; wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:
    0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br> psz@azaona:~$ date --rfc-3339=ns; ps -ouser,lstart,command | grep -E &#39;psz.*grep|USER&#39;<br>
    2025-04-15 19:38:41.589754682+10:00<br>
    USER                      STARTED COMMAND<br>
    psz      Tue Apr 15 19:38:40 2025 grep -E psz.*grep|USER<br>

    Surely worth re-opening, and fixing anytime in the next 20 years?<br></blockquote><div>I&#39;ve had another look at this, I&#39;ve been looking at the angle from start time to boot time, but that might not be where the issue is.</div><div><br></div><div>
    lstart comes from boot_time + TICS_BEGAN which is then converted to a real time with localtime and strftime</div><div>boot_time comes from the btime field in /proc/stat</div><div>TICS_BEGAN comes from field 22 of /proc/PID/stat (converted from Hz, or
    divided by 100).</div><div><br></div><div>So, could btime be wrong? Or rather be correct at time of boot and then the system (once network is up and ntp is online) change its systen time?</div><div>$ date +%s ; btime=`grep btime /proc/stat |cut -f 2 -d&#
    39; &#39;` ; utime=`cut -f 1 -d&#39;.&#39; /proc/uptime` ; date +%s ; now=$((utime + btime)) ; echo $now</div>1744714188<br>1744714188<br>1744714187</div><div class="gmail_quote gmail_quote_container"><br><div> - Craig</div><div><br></div></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)