aboutsummaryrefslogtreecommitdiff
path: root/libps/ps.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-01-16 23:59:00 +0100
committerRichard Braun <rbraun@sceen.net>2014-01-16 23:59:00 +0100
commit9bebcd38f42da289a3eaf9f473a9529f8d3c4664 (patch)
treef043005ce43b176c57f9b773817381271c217506 /libps/ps.h
parent9a7776ddef6626536f21c09090b8329168a053ce (diff)
downloadhurd-9bebcd38f42da289a3eaf9f473a9529f8d3c4664.tar.gz
hurd-9bebcd38f42da289a3eaf9f473a9529f8d3c4664.tar.bz2
hurd-9bebcd38f42da289a3eaf9f473a9529f8d3c4664.zip
libps: fix task/thread times fetching
Introduce PSTAT_TIMES to force the retrieval of both PSTAT_TASK_BASIC and PSTAT_THREAD_BASIC. Task basic info contain the user and system times of terminated threads which the code wrongly assumes is always present along with process info. * libps/procstat.c (add_preconditions): Set both PSTAT_TASK_BASIC and PSTAT_THREAD_BASIC as preconditions for PSTAT_TIMES. (summarize_thread_basic_info): Add terminated threads times only if task basic info are available. (set_procinfo_flags): Provide summarize_thread_basic_info with flags of available info. (proc_stat_set_flags): Set PSTAT_TIMES as available if it was needed and any of PSTAT_TASK_BASIC or PSTAT_THREAD_BASIC could be fetched. * libps/ps.h (PSTAT_TIMES): New macro. * libps/spec.c (ps_get_usr_time): Indicate the getter needs PSTAT_TIMES instead of PSTAT_THREAD_BASIC. (ps_sys_time_getter): Likewise. (ps_tot_time_getter): Likewise.
Diffstat (limited to 'libps/ps.h')
-rw-r--r--libps/ps.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libps/ps.h b/libps/ps.h
index bcc43f8b..06af96bc 100644
--- a/libps/ps.h
+++ b/libps/ps.h
@@ -343,6 +343,7 @@ struct proc_stat
#define PSTAT_UMASK 0x400000 /* The proc's current umask */
#define PSTAT_HOOK 0x800000 /* Has a non-zero hook */
#define PSTAT_NUM_PORTS 0x4000000 /* Number of Mach ports in the task */
+#define PSTAT_TIMES 0x8000000 /* Task/thread user and system times */
/* Flag bits that don't correspond precisely to any field. */
#define PSTAT_NO_MSGPORT 0x1000000 /* Don't use the msgport at all */