* fhandler_process.cc (format_process_stat): Use cygwin-derived start time even

on NT since it is the logical start time of the "process".
* pinfo.cc (set_myself): Don't set start time when it should have already been
set previously.
This commit is contained in:
Christopher Faylor 2006-02-11 04:53:14 +00:00
parent 5a8a5efcfd
commit 472130e897
3 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2006-02-10 Christopher Faylor <cgf@timesys.com>
* fhandler_process.cc (format_process_stat): Use cygwin-derived start
time even on NT since it is the logical start time of the "process".
* pinfo.cc (set_myself): Don't set start time when it should have
already been set previously.
2006-02-10 Brian Ford <Brian.Ford@FlightSafety.com> 2006-02-10 Brian Ford <Brian.Ford@FlightSafety.com>
* times.cc (clock_getres): Use correct conversion from milliseconds to * times.cc (clock_getres): Use correct conversion from milliseconds to

View File

@ -639,9 +639,8 @@ format_process_stat (_pinfo *p, char *destbuf, size_t maxsize)
state = 'T'; state = 'T';
else if (wincap.is_winnt ()) else if (wincap.is_winnt ())
state = get_process_state (p->dwProcessId); state = get_process_state (p->dwProcessId);
if (!wincap.is_winnt ()) start_time = (GetTickCount () / 1000 - time (NULL) + p->start_time) * HZ;
start_time = (GetTickCount () / 1000 - time (NULL) + p->start_time) * HZ; if (wincap.is_winnt ())
else
{ {
NTSTATUS ret; NTSTATUS ret;
HANDLE hProcess; HANDLE hProcess;
@ -700,7 +699,6 @@ format_process_stat (_pinfo *p, char *destbuf, size_t maxsize)
fault_count = vmc.PageFaultCount; fault_count = vmc.PageFaultCount;
utime = put.UserTime.QuadPart * HZ / 10000000ULL; utime = put.UserTime.QuadPart * HZ / 10000000ULL;
stime = put.KernelTime.QuadPart * HZ / 10000000ULL; stime = put.KernelTime.QuadPart * HZ / 10000000ULL;
start_time = (put.CreateTime.QuadPart - stodi.BootTime.QuadPart) * HZ / 10000000ULL;
#if 0 #if 0
if (stodi.CurrentTime.QuadPart > put.CreateTime.QuadPart) if (stodi.CurrentTime.QuadPart > put.CreateTime.QuadPart)
start_time = (spt.KernelTime.QuadPart + spt.UserTime.QuadPart - start_time = (spt.KernelTime.QuadPart + spt.UserTime.QuadPart -

View File

@ -61,7 +61,6 @@ set_myself (HANDLE h)
/* here if execed */ /* here if execed */
static pinfo NO_COPY myself_identity; static pinfo NO_COPY myself_identity;
myself_identity.init (cygwin_pid (myself->dwProcessId), PID_EXECED, NULL); myself_identity.init (cygwin_pid (myself->dwProcessId), PID_EXECED, NULL);
myself->start_time = time (NULL); /* Register our starting time. */
myself->exec_sendsig = NULL; myself->exec_sendsig = NULL;
myself->exec_dwProcessId = 0; myself->exec_dwProcessId = 0;
} }