diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 15 | ||||
| -rw-r--r-- | src/w32.c | 14 |
2 files changed, 24 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index aecb28d3dd2..dcbf8f8bd9e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2009-01-02 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32.c (process_times): Compute sum of utime and stime. | ||
| 4 | (system_process_attributes): Add Qtime to the alist. | ||
| 5 | |||
| 6 | * sysdep.c (system_process_attributes): Compute Qtime and Qctime | ||
| 7 | and add them to the alist. | ||
| 8 | |||
| 9 | * process.c (top level) <Qtime, Qctime>: New variables. | ||
| 10 | (syms_of_process): staticpro them. | ||
| 11 | (Fsystem_process_attributes): Add their documentation to the doc | ||
| 12 | string. | ||
| 13 | |||
| 14 | * process.h: Declare Qtime and Qctime. | ||
| 15 | |||
| 1 | 2009-01-02 Jason Rumney <jasonr@gnu.org> | 16 | 2009-01-02 Jason Rumney <jasonr@gnu.org> |
| 2 | 17 | ||
| 3 | * image.c: (Qgobject): New symbol. | 18 | * image.c: (Qgobject): New symbol. |
| @@ -3771,14 +3771,14 @@ ltime (time_sec, time_usec) | |||
| 3771 | } | 3771 | } |
| 3772 | 3772 | ||
| 3773 | static int | 3773 | static int |
| 3774 | process_times (h_proc, ctime, etime, stime, utime, pcpu) | 3774 | process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu) |
| 3775 | HANDLE h_proc; | 3775 | HANDLE h_proc; |
| 3776 | Lisp_Object *ctime, *etime, *stime, *utime; | 3776 | Lisp_Object *ctime, *etime, *stime, *utime, *ttime; |
| 3777 | double *pcpu; | 3777 | double *pcpu; |
| 3778 | { | 3778 | { |
| 3779 | FILETIME ft_creation, ft_exit, ft_kernel, ft_user, ft_current; | 3779 | FILETIME ft_creation, ft_exit, ft_kernel, ft_user, ft_current; |
| 3780 | long ctime_sec, ctime_usec, stime_sec, stime_usec, utime_sec, utime_usec; | 3780 | long ctime_sec, ctime_usec, stime_sec, stime_usec, utime_sec, utime_usec; |
| 3781 | long etime_sec, etime_usec; | 3781 | long etime_sec, etime_usec, ttime_sec, ttime_usec; |
| 3782 | long double tem1, tem2, tem; | 3782 | long double tem1, tem2, tem; |
| 3783 | 3783 | ||
| 3784 | if (!h_proc | 3784 | if (!h_proc |
| @@ -3797,6 +3797,9 @@ process_times (h_proc, ctime, etime, stime, utime, pcpu) | |||
| 3797 | utime_usec = fmodl (tem2, 1000000.0L); | 3797 | utime_usec = fmodl (tem2, 1000000.0L); |
| 3798 | utime_sec = tem2 * 0.000001L; | 3798 | utime_sec = tem2 * 0.000001L; |
| 3799 | *utime = ltime (utime_sec, utime_usec); | 3799 | *utime = ltime (utime_sec, utime_usec); |
| 3800 | ttime_usec = fmodl (tem1 + tem2, 1000000.0L); | ||
| 3801 | ttime_sec = (tem1 + tem2) * 0.000001L; | ||
| 3802 | *ttime = ltime (ttime_sec, ttime_usec); | ||
| 3800 | tem = convert_time_raw (ft_creation); | 3803 | tem = convert_time_raw (ft_creation); |
| 3801 | /* Process no 4 (System) returns zero creation time. */ | 3804 | /* Process no 4 (System) returns zero creation time. */ |
| 3802 | if (tem) | 3805 | if (tem) |
| @@ -3850,7 +3853,7 @@ system_process_attributes (pid) | |||
| 3850 | MEMORYSTATUS memst; | 3853 | MEMORYSTATUS memst; |
| 3851 | MEMORY_STATUS_EX memstex; | 3854 | MEMORY_STATUS_EX memstex; |
| 3852 | double totphys = 0.0; | 3855 | double totphys = 0.0; |
| 3853 | Lisp_Object ctime, stime, utime, etime; | 3856 | Lisp_Object ctime, stime, utime, etime, ttime; |
| 3854 | double pcpu; | 3857 | double pcpu; |
| 3855 | BOOL result = FALSE; | 3858 | BOOL result = FALSE; |
| 3856 | 3859 | ||
| @@ -4109,10 +4112,11 @@ system_process_attributes (pid) | |||
| 4109 | attrs = Fcons (Fcons (Qpmem, make_float (100. * rss / totphys)), attrs); | 4112 | attrs = Fcons (Fcons (Qpmem, make_float (100. * rss / totphys)), attrs); |
| 4110 | } | 4113 | } |
| 4111 | 4114 | ||
| 4112 | if (process_times (h_proc, &ctime, &etime, &stime, &utime, &pcpu)) | 4115 | if (process_times (h_proc, &ctime, &etime, &stime, &utime, &ttime, &pcpu)) |
| 4113 | { | 4116 | { |
| 4114 | attrs = Fcons (Fcons (Qutime, utime), attrs); | 4117 | attrs = Fcons (Fcons (Qutime, utime), attrs); |
| 4115 | attrs = Fcons (Fcons (Qstime, stime), attrs); | 4118 | attrs = Fcons (Fcons (Qstime, stime), attrs); |
| 4119 | attrs = Fcons (Fcons (Qtime, ttime), attrs); | ||
| 4116 | attrs = Fcons (Fcons (Qstart, ctime), attrs); | 4120 | attrs = Fcons (Fcons (Qstart, ctime), attrs); |
| 4117 | attrs = Fcons (Fcons (Qetime, etime), attrs); | 4121 | attrs = Fcons (Fcons (Qetime, etime), attrs); |
| 4118 | attrs = Fcons (Fcons (Qpcpu, make_float (pcpu)), attrs); | 4122 | attrs = Fcons (Fcons (Qpcpu, make_float (pcpu)), attrs); |