aboutsummaryrefslogtreecommitdiff
path: root/libps/procstat.c
Commit message (Collapse)AuthorAgeFilesLines
* 2002-06-05 Roland McGrath <roland@frob.com>Roland McGrath2002-06-051-19/+7
| | | | | | | | * procstat.c (fetch_procinfo): Use PI_FETCH_TASKEVENTS. (add_preconditions): PSTAT_TASK_EVENTS no longer needs PSTAT_TASK. (PSTAT_PROCINFO_TASK): Add PSTAT_TASK_EVENTS to the mask. (PSTAT_PROCINFO_MERGE): Here too. (proc_stat_set_flags): Don't use task_info for PSTAT_TASK_EVENTS.
* 2002-05-07 Roland McGrath <roland@frob.com>Roland McGrath2002-05-081-1/+1
| | | | | | | | | * host.c (ps_host_basic_info): int -> size_t (ps_host_basic_info, ps_host_load_info): Likewise. * ps.h: Update decls. (struct proc_stat): unsigned -> size_t for task_events_info_size, args_len, env_len. * procstat.c (summarize_thread_waits): Fix argument type.
* 1999-07-03 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell1999-07-031-4/+2
| | | | | * common.h (VMFREE): Use munmap instead of vm_deallocate. * procstat.c (merge_procinfo): Likewise.
* 1999-06-02 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-06-021-1/+22
| | | | | | | | | | | * ps.h (PSTAT_ENV): New macro. (struct proc_stat): New members `env', `env_len', `env_vm_alloced'. (proc_stat_env, proc_stat_env_len): New accessor macros. (PSTAT_USER_BASE): Increase value to leave more room for additions. * procstat.c (proc_stat_set_flags): Handle environment. (_proc_stat_free): Likewise. * spec.c (ps_get_env, ps_env_getter): New function and constant. (specs): New spec "Env" using ps_env_getter and ps_emit_args.
* Add braces to silence gcc warnings.Roland McGrath1998-10-201-57/+65
|
* fix typoThomas Bushnell1997-05-231-1/+1
|
* Fri May 23 13:13:18 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>Thomas Bushnell1997-05-231-5/+10
| | | | | | | | * procstat.c (summarize_thread_basic_info): Don't include the kernel's idle threads in the summation. (summarize_thread_sched_info): Likewise. (summarize_thread_states): Likewise. (summarize_thread_waits): Likewise.
* (proc_stat_set_flags):Miles Bader1996-11-161-3/+6
| | | | | Allow the user fetch hook to turn on non-user bits, even if they've already failed in the standard code.
* (proc_stat_set_flags):Miles Bader1996-10-081-8/+3
| | | | | Get rid of INAPP macro. Fix preconditions of PSTAT_SUSPEND_COUNT.
* (proc_stat_thread_create):Miles Bader1996-10-081-38/+75
| | | | | | | | | | | | | | | | | | | Initialize FAILED and INAPP fields. (PSTAT_PROCINFO): Redefined. (set_procinfo_flags): Set bits in PS->inapp as appropriate. (count_threads): Use PSTAT_PROCINFO_TASK_THREAD_DEP. (PSTAT_PROCINFO_TASK_THREAD_DEP): Renamed from PSTAT_PROCINFO_THREAD. (PSTAT_PROCINFO_THREAD, PSTAT_PROCINFO_TASK): New macro. (proc_stat_set_flags): Add NEED & INAPP macros, and use them to set the inapp field as well as the failed field. (_proc_stat_create): Initialize INAPP field.
* (set_procinfo_flags): Pass HAVE to count_threads.Miles Bader1996-08-021-10/+18
| | | | | (count_threads): Take new argument HAVE, and use different thread counting method depending on whether we have thread detail info.
* (set_procinfo_flags): Don't use fake "*" wait value if there's no msgport.Miles Bader1996-07-111-1/+2
|
* (proc_stat_set_flags):Miles Bader1996-07-021-1/+1
| | | | Pass PS->task_events_info to task_info, not its address.
* (merge_procinfo):Miles Bader1996-06-031-60/+72
| | | | | | | | | | | | | | | Take a struct proc_stat as an arg, not all the individual fields. Correctly set old_pi_hdr. Correctly calculate REALLY_NEED. (set_procinfo_flags): Use new calling merge_procinfo calling convention. (proc_stat_set_flags): Try mallocing a buffer for PS->args. Move second call to set_procinfo_flags after msgport suppress test. Add TEST_MSGPORT_FLAGS variable, & use it. Be more picky about when we call set_procinfo_flags. (_proc_stat_free): Use explicit VM_ALLOCED flag for MFREEMEM.
* (set_procinfo_flags): New function.Miles Bader1996-06-021-199/+246
| | | | | | | | | | | (proc_stat_set_flags): Use it, to get msgport validity testing right. (merge_procinfo): Take and return HAVE instead of using a reference parameter. Do mem allocation more efficiently and correctly. (fetch_procinfo): Do conversion for PI_SIZE from/to units of sizeof (int), so no one else has to deal with it. (PROCINFO_MALLOC_SIZE, WAITS_MALLOC_SIZE): New macros. (MFREEMEM): New macro combining MFREEM & MFREEVM. (MFREEM, MFREEVM): Macros deleted.
* (proc_stat_set_flags): After fetching number of threads to guess whether weMiles Bader1996-05-311-14/+38
| | | | | | | | need wait info, put it in PS->num_threads. (merge_procinfo): Avoid vm_allocing a procinfo buffer each time if we can help it. Correctly reflect newly fetched info. (PSTAT_PROCINFO_MERGE, PSTAT_PROCINFO_REFETCH): New macros.
* (MP_MGET): Only disable msgport on timeout.Miles Bader1996-05-291-15/+12
| | | | | | | (get_thread_wait): Decrement N in loop. (get_thread_wait): Use strnlen instead of memchr. (PSTAT_PROCINFO): Typo: PSTAT_THREAD_WAIT --> PSTAT_THREAD_WAITS. (PSTAT_USES_MSGPORT): Add PSTAT_THREAD_WAIT.
* (merge_procinfo): Don't die if WAITS == 0.Miles Bader1996-05-291-16/+32
| | | | | | | (summarize_thread_waits): Correctly advance NEXT_WAIT. Skip threads marked `itimer'. (proc_stat_set_flags): Consider processes with less than 4 threads to be candidates for a meaningful process wait status.
* (merge_procinfo): And update *HAVE with PSTAT_PROC_INFO fromMichael I. Bushnell1996-05-241-1/+2
| | | | REALLY_HAVE here.
* (fetch_procinfo): Always turn on PSTAT_PROC_INFO if proc_getprocinfoMichael I. Bushnell1996-05-241-0/+1
| | | | returns successfully.
* (PSTAT_PROCINFO, PSTAT_PROCINFO_THREAD): Add PSTAT_THREAD_WAITS.Miles Bader1996-05-131-27/+69
| | | | | | | | | (proc_stat_set_flags): Be more careful about when we fetch thread_wait information, and synthesize a process-summary thread_wait value for lots of threads. (summarize_thread_waits): Only give a real summary if there's but a single user thread. (fetch_procinfo): Use PSTAT_THREAD_WAITS instead of PSTAT_THREAD_WAIT.
* (merge_procinfo, fetch_procinfo): Change HAVE to be an input/output parameter.Miles Bader1996-05-121-30/+40
| | | | | (proc_stat_set_flags): Change accordingly. (get_thread_wait): Correctly advance WAIT.
* (get_thread_wait): Correctly advance WAIT.Miles Bader1996-05-121-1/+5
|
* Frob comment.Miles Bader1996-05-121-1/+3
|
* (fetch_procinfo): Pass a reference to PI_FLAGS in call toMichael I. Bushnell1996-05-091-1/+1
| | | | fetch_procinfo.
* (add_preconditions, proc_stat_set_flags): Remove references to exec_flags.Miles Bader1996-05-071-6/+1
|
* (proc_stat_set_flags): Use new `ps_' prefix for msg rpcs.Miles Bader1996-03-271-7/+11
| | | | Include "ps_msg.h".
* Get rid of mega typedefs, and just use structure pointers like other hurdMiles Bader1996-03-261-54/+54
| | | | libraries. Other misc cleanups.
* (fetch_procinfo, merge_procinfo): Return wait strings.Miles Bader1996-02-131-33/+74
| | | | | | | (summarize_thread_waits): Return both wait and rpc info. (get_thread_wait): New function. (proc_stat_set_flags): Support finding wait info. Change occurances of PSTAT_THREAD_RPC to PSTAT_THREAD_WAIT.
* (summarize_thread_basic_info):Miles Bader1996-01-191-14/+61
| | | | | | | | If there are any running threads, then only average priority from them. (_proc_stat_free): Call user cleanup hook. (proc_stat_set_flags, add_preconditions): Deal with user bits. (proc_stat_set_flags): Support the failed field. (_proc_stat_create): Initialize the failed and hook fields.
* (proc_stat_set_flags): If there's no owner, set the uid to -1 (and the ownerMiles Bader1995-12-201-2/+20
| | | | | | to null), instead of failing. (proc_stat_set_flags): Add support for PROC_OWNER_UID. (add_preconditions): Add preconditions for owner_uid (& owner).
* (proc_stat_set_flags):Miles Bader1995-11-081-17/+49
| | | | | | | | | | | | | | Initialize the proc_info and proc_info_size fields if they've never been set. Always update proc_getprocinfo fields, even if we already had them. (add_preconditions): Correct preconditions for PSTAT_STATE. (PSTAT_TEST_MSGPORT): Renamed from SHOULD_SUPPRESS_MSGPORT_FLAGS. (PSTAT_USES_MSGPORT): New macro. (SUPPRESS_MSGPORT_FLAGS): Use PSTAT_USES_MSGPORT, not PSTAT_MSGPORT. (proc_stat_set_flags): Use PSTAT_TEST_MSGPORT. (merge_procinfo): Only copy old task info if we actually had it. (proc_stat_set_flags): Don't unnecessarily grab procinfo stuff. (summarize_thread_basic_info): Summarize available priority info too. (summarize_thread_sched_info): Do max_ & depress_priority too.
* (add_preconditions): Don't require PSTAT_EXEC_FLAGS for getting the stateMiles Bader1995-11-031-140/+401
| | | | | | | | | | | | | | | | | | | anymore (but do require PSTAT_{TASK,THREAD}_BASIC). (proc_stat_state_tags): Update to reflect new flags. (proc_stat_set_flags): Set new flags. (PSTAT_PROCINFO, PSTAT_PROCINFO_THREAD): New macros. (fetch_procinfo, merge_procinfo): New functions. (SHOULD_SUPPRESS_MSGPORT_FLAGS): Change to use more accurate flags. (should_suppress_msgport): Use new fields. (summarize_thread_basic_info, summarize_thread_sched_info, summarize_thread_states, summarize_thread_rpcs, count_threads): New funcs. (proc_stat_set_flags): Support the new division of PSTAT_INFO into individual flags, and support getting thread information by using the thread's origin proc_stat. (_proc_stat_free): Free the thread_basic_info and thread_sched_info fields if necessary. (proc_stat_thread_create): Don't require that the source process have thread information around; it will be fetched later if necessary.
* (thread_state, proc_stat_set_flags): Use the new state bits.Miles Bader1995-08-191-20/+19
| | | | | | (proc_stat_set_flags): Actually set the PSTAT_STATE_P_STOP bit. (proc_stat_state_tags): Reordered to reflect the new ordering of the state bits.
* If a msg port call times out, disable use of that msg port.Miles Bader1995-05-051-32/+51
|
* (proc_stat_set_flags, add_preconditions): Add support for the suspend_countMiles Bader1995-05-021-0/+15
| | | | field.
* (add_preconditions): A new function that calculates inter-flag dependencies;Miles Bader1995-05-021-29/+91
| | | | | | | | | | | code moved here from from proc_stat_set_flags. (should_suppress_msgport): A new function that returns true when there's some condition indicating that we shouldn't use a process's msg port. (proc_stat_set_flags): Avoid using a process's msg port when it may be unusable. (proc_stat_set_flags): Set PSTAT_STATE_FORKED instead of PSTAT_STATE_EXECED. (proc_stat_state_tags): Change the user state letter to "f" from "e".
* Tighten up types used (i.e., don't use int for everything).Miles Bader1995-04-071-6/+6
|
* (proc_stat_set_flags): If PSTAT_NO_MSGPORT is set, don't use the msg port.Miles Bader1995-04-051-3/+10
|
* Don't get barf on processes with zero threads.Miles Bader1995-03-291-4/+6
|
* Add support for the exec_flags field, and make the state bits calculation useMiles Bader1995-03-281-2/+11
| | | | | that to support the PSTAT_STATE_TRACED bit. Update proc_stat_state_tags to add PSTAT_STATE_TRACED.
* Include <string.h>.Michael I. Bushnell1995-03-211-0/+1
|
* Set the PSTAT_STATE_PRIORITY and PSTAT_STATE_NICED flags when appropiate.Miles Bader1995-03-151-0/+5
|
* A proc_stat_t points to a ps_context_t now instead of directly to the procMiles Bader1995-03-141-53/+22
| | | | | | | server (but we can get the proc server from the context). Added the owner (ps_user_t) field to proc_stat_t, and tty now points to a ps_tty_t instead of to a tty port; tty_name is deleted since that gets handled in the ps_tty_t.
* Initial revisionMiles Bader1995-03-131-0/+419