This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: ps -W displays timestamps oddly


> -----Original Message-----
> From: cygwin-owner On Behalf Of Christopher Cobb
> Sent: 22 October 2004 03:14

> view_server.exe  18/10/2004 18:55:57 14:55:57 
> D:\rational\ClearCase\bin\view_ser
> view_server.exe  18/10/2004 18:55:57 14:55:58 
> D:\rational\ClearCase\bin\view_ser
>    explorer.exe  18/10/2004 18:55:58 14:55:58 C:\WINDOWS\Explorer.EXE
>      shstat.exe  18/10/2004 18:56:04 14:56:05 C:\Program 
> Files\Network Associate
>         cmd.exe  19/10/2004 02:00:06 22:00:06 
> C:\WINDOWS\System32\cmd.exe
>        sshd.exe  19/10/2004 12:54:58 08:54:59 
> D:\cygwin\usr\sbin\sshd.exe
>        bash.exe  19/10/2004 12:54:59 08:55:00 D:\cygwin\bin\bash.exe
>        bash.exe  19/10/2004 12:55:00 08:55:00 /usr/bin/bash
> ...
> 
> The left side is "process", the right side is "ps -W".

  They're all four hours out.  You probably need to set your timezone or
something.

> ps normally only shows timestamps for processes that began 
> /today/.  For
> processes that began before today, only the /date/ is shown 

http://www.opengroup.org/onlinepubs/009695399/utilities/ps.html

demands no such thing.  Doesn't even hint at it, in fact.  Nor does "man
ps", nor does http://cygwin.com/cygwin-ug-net/using-utils.html, which "man
ps" refers to as definitive for cygwin's ps.

  Besides, what time was it when you took that ps -W output?  On my install,
"ps -W" shows datestamps for processes that are >24hrs old; it assumes
you're capable of looking at your own clock and knowing whether the times it
lists must then be today's or yesterday's.  You left the timestamp for ps
out of the example you showed above.  If you hadn't omitted that vital
information I could have told you exactly what was going on in your example
above from only the ps output.  Just to prove it to you, here's the
essential details from your original post, with the time at which you ran
the ps command showing:

3948    ?    0   Oct 17 C:\WINDOWS\System32\svch
2824    ?    0   Oct 17 C:\PROGRA~1\Dell\OPENMA~
2812    ?    0   Oct 17 D:\rational\ClearCase\bi
6824    ?    0 14:55:57 D:\rational\ClearCase\bi
6156    ?    0 14:55:58 D:\rational\ClearCase\bi
5272    ?    0 14:55:58 C:\WINDOWS\Explorer.EXE
5360    ?    0 14:56:05 C:\Program Files\Network
4300    ?    0 22:00:06 C:\WINDOWS\System32\cmd.
4596    ?    0 08:54:59 D:\cygwin\usr\sbin\sshd.
5160    ?    0 08:55:00 D:\cygwin\bin\bash.exe
6308    0 83948 08:55:00 /usr/bin/bash
4152    ?    0 08:55:00 D:\cygwin\bin\sh.exe
7172    0 83948 08:55:00 /usr/bin/sh
6716    ?    0 08:55:00 D:\cygwin\bin\sort.exe
7152    ?    0 08:55:00 D:\cygwin\usr\sbin\frcod
4688    ?    0 08:55:00 D:\cygwin\bin\find.exe
5448    0 83948 08:58:12 /usr/bin/tail
7680    0 83948 08:58:12 /usr/bin/fold
2844    ?    0 08:58:12 D:\cygwin\bin\ps.exe

  Now then, since you were running the ps command at 08:58, I know that all
those 08:55 processes were startes a few minutes earlier (I'll bet it's your
ssh session).  I also *know* for an absolute fact, without ps having to
spell it out for me in words of one syllable, that those processes from
22:00 and 14:55 were from yesterday.  How do I know that?  Because they
can't possibly be from the future!

  Seriously.  It's not if they were started before midnight and it's now
after midnight that ps shows a timestamp.  It's if they're more than 24
hours old, in which case it would no longer be possible to deduce _which_
14:55 or 22:00 was being referred to.  The output from ps that you have been
complaining about is utterly unambiguous.  Your expectations are what needs
adjusting here, not the output.

> Bottom line:  by showing a /timestamp/ instead of a /date/, 
> ps is suggesting
> that these processes were started /today/ at the specified 
> time.  This is /wrong/.  

  The wrong thing is your quite ludicrous false inference.  When you say it
is suggesting that those processes were started "today at the specified
time", you should have noticed that the time in question had not yet
occurred today, and therefore had to refer to yesterday.  It's incoherent of
you to assume that ps would claim a process began in the future.

  http://cygwin.com/acronyms#YOWTWYWT !

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]