[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 89/98: libps: fix process user and system times
From: |
Samuel Thibault |
Subject: |
[hurd] 89/98: libps: fix process user and system times |
Date: |
Tue, 14 Jan 2014 02:00:05 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 19689c97a05e0a10691b671c4c37ca0bf51bdd2b
Author: Richard Braun <address@hidden>
Date: Mon Dec 30 15:08:29 2013 +0100
libps: fix process user and system times
Include the run time of terminated threads in the user and system times
of processes.
---
libps/procstat.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/libps/procstat.c b/libps/procstat.c
index e688fa4..e732f75 100644
--- a/libps/procstat.c
+++ b/libps/procstat.c
@@ -352,6 +352,7 @@ summarize_thread_basic_info (struct procinfo *pi)
{
int i;
unsigned num_threads = 0, num_run_threads = 0;
+ task_basic_info_t taskinfo = &pi->taskinfo;
thread_basic_info_t tbi = malloc (sizeof (struct thread_basic_info));
int run_base_priority = 0, run_cur_priority = 0;
int total_base_priority = 0, total_cur_priority = 0;
@@ -426,6 +427,12 @@ summarize_thread_basic_info (struct procinfo *pi)
}
}
+ /* Include the run time of terminated threads. */
+ tbi->user_time.seconds += taskinfo->user_time.seconds;
+ tbi->user_time.microseconds += taskinfo->user_time.microseconds;
+ tbi->system_time.seconds += taskinfo->system_time.seconds;
+ tbi->system_time.microseconds += taskinfo->system_time.microseconds;
+
tbi->user_time.seconds += tbi->user_time.microseconds / 1000000;
tbi->user_time.microseconds %= 1000000;
tbi->system_time.seconds += tbi->system_time.microseconds / 1000000;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 88/98: libports: remove the threadvars stack size hack, (continued)
- [hurd] 88/98: libports: remove the threadvars stack size hack, Samuel Thibault, 2014/01/13
- [hurd] 02/98: Normalize whitespace at the end of each file to '\n', Samuel Thibault, 2014/01/13
- [hurd] 84/98: utils/rpctrace: handle MACH_MSG_TYPE_PORT_SEND rights in trace_and_forward, Samuel Thibault, 2014/01/13
- [hurd] 82/98: utils/rpctrace: generalize code in rewrite_right, Samuel Thibault, 2014/01/13
- [hurd] 86/98: utils/rpctrace: fix output so that replies can be attributed to requests, Samuel Thibault, 2014/01/13
- [hurd] 81/98: utils/mount: fix autodetection of fat file systems, Samuel Thibault, 2014/01/13
- [hurd] 79/98: trans/fakeroot: remove dead code, Samuel Thibault, 2014/01/13
- [hurd] 85/98: utils/rpctrace: escape non-printable characters in strings, Samuel Thibault, 2014/01/13
- [hurd] 80/98: trans/fakeroot: remove dead code, Samuel Thibault, 2014/01/13
- [hurd] 83/98: utils/rpctrace: generalize tracing code, Samuel Thibault, 2014/01/13
- [hurd] 89/98: libps: fix process user and system times,
Samuel Thibault <=
- [hurd] 87/98: trans/fakeroot: shutdown the translator if the last client is gone, Samuel Thibault, 2014/01/13