summaryrefslogtreecommitdiff
path: root/libps/ps.h
AgeCommit message (Collapse)Author
2015-01-03lib*: Fix typos in comments (found by codespell)Stefan Weil
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2014-01-16libps: fix task/thread times fetchingRichard Braun
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.
2012-10-22libps: Fix typo in the documentation of _proc_stat_create.Cyril Roelandt
* libps/ps.h: Refer to ps_context_find_proc_stat instead of pc_context_find_proc_stat.
2011-08-20fix common misspellingsJonathan Neuschäfer
* Fix spelling with codespell[1] and manually review it. [1] http://git.profusion.mobi/cgit.cgi/lucas/codespell/
2010-09-18Obtain number of ports in proc and libpsantrik
Add (and implement) a proc RPC to obtain the number of Mach ports used by the target task. Add infrastructure in libps to read this information. * hurd/process.defs (proc_getnports): New RPC. * hurd/process_request.defs (proc_getnports_request): New RPC. * libps/procstat.c (proc_stat_set_flags): Call proc_getnports RPC if needed. * libps/ps.h (proc_stat): New `num_ports' field. (PSTAT_NUM_PORTS): New macro. (proc_stat_num_ports): New macro. * libps/spec.c (ps_get_num_ports): New function. (ps_num_ports_getter): New variable. (specs): New entry for `ps_num_ports_getter'. * proc/info.c (S_proc_getnports): New function.
2010-08-31Document incoherency for storage of task_events_infoSamuel Thibault
It doesn't produce any bug ATM just because GNU Mach does not support it. * libps/ps.h (struct proc_stat): Document that task_events_info is currently actually fetched into proc_info.
2010-08-26libps (_proc_stat_free): Fix memory leakJeremie Koenig
The thread_waits field was never freed; this change adds the code to do so if the corresponding flag is set. Users are also warned of the consequences, namely, that they should not free process proc_stats before all their associated thread ones are gone, since the latter may reference the former's thread_waits field. However, with the normal interface (ie. ps_context_free), all proc_stats are freed at once, so this is not an issue. * libps/procstat.c (_proc_stat_free): Free ps->thread_waits if PSTAT_THREAD_WAITS flag is set. * libps/ps.h (_proc_stat_free): Document that thread proc_stats must be freed before process proc_stat can be.
2004-03-01auth/Marcus Brinkmann
2003-08-17 Marcus Brinkmann <marcus@gnu.org> * auth.c: Include <stddef.h>. (pending_users, pending_server): Change type to struct hurd_ihash, initialize with HURD_IHASH_INITIALIZER. (struct pending): Change type of member LOCP to hurd_ihash_locp_t. (S_auth_user_authenticate): Use hurd_ihash_* functions instead ihash_*. (S_auth_server_authenticate): Likewise. (main): Do not allocate the hash tables. console-client/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * vga-dynafont.c: Include <stddef.h>. (struct mapped_character): Change type of LOCP to hurd_ihash_locp_t. (struct dynafont): Change type of CHARMAP to struct hurd_ihash. (dynafont_new): Use hurd_ihash_init instead of ihash_create. Remove variable ERR. Call hurd_ihash_add instead of ihash_add. (dynafont_free): Call hurd_ihash_destroy, no ihash_free. (dynafont_lookup_internal): Use hurd_ihash_find, not ihash_find. (dynafont_lookup_internal): Call hurd_ihash_locp_remove instead ihash_locp_remove, and hurd_ihash_add instead ihash_add. (dynafont_change_font): Likewise. Clean out LOCP if character is unmapped. ftpfs/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * ftpfs.h: Include <hurd/ihash.h>. (struct ftpfs): Change type of INODE_MAPPINGS to struct hurd_ihash. (struct ftpfs_dir_entry): Change type of INODE_LOCP to hurd_ihash_locp_t. * node.c (ftpfs_create_node): Call hurd_ihash_add, not ihash_add. (netfs_node_norefs): Call hurd_ihash_locp_remove, not ihash_locp_remove. * fs.c: Include <stddef.h>. (ftpfs_create): Call hurd_ihash_init, not hurd_ihash_create. Call hurd_ihash_destroy on error. libihash/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * ihash.c: Rewritten. * ihash.h: Rewritten. * Makefile (SRCS): Remove sizes.c. (LCLHDRS): Remove priv.h. * primes.c, sizes.c, priv.h: Files removed. 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * ports.h (struct port_bucket): Change type of HTABLE to struct hurd_ihash. (struct port_info): Change type of HENTRY to hurd_ihash_locp_t. * lookup-port.c (ports_lookup_port): Use hurd_ihash_find instead ihash_find. * bucket-iterate.c (_ports_bucket_class_iterate): Use HURD_IHASH_ITERATE instead ihash_iterate. * inhibit-all-rpcs.c (ports_inhibit_all_rpcs): Likewise. * inhibit-bucket-rpcs.c (ports_inhibit_bucket_rpcs): Likewise. * create-internal.c (_ports_create_port_internal): Use hurd_ihash_add instead ihash_add. * import-port.c (ports_import_port): Likewise. * reallocate-from-external.c (ports_reallocate_from_external): Likewise. * reallocate-port.c (ports_reallocate_port): Likewise. * transfer-right.c (ports_transfer_right): Likewise. * create-bucket.c: Include <stddef.h>. (ports_create_bucket): Use hurd_ihash_init instead hurd_ihash_create. * class-iterate.c: Do not include <hurd/ihash.h>. * claim-right.c (ports_claim_right): Call hurd_ihash_locp_remove instead ihash_locp_remove. * complete-deallocate.c (_ports_complete_deallocate): Likewise. * destroy-right.c (ports_destroy_right): Likewise. * reallocate-from-external.c (ports_reallocate_from_external): Likewise. * reallocate-port.c (ports_reallocate_port): Likewise. * transfer-right.c (ports_transfer_right): Likewise. libps/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * ps.h (struct ps_context): Change type of members procs, ttys, ttys_by_cttyid and users to struct hurd_ihash. * context.c (ps_context_create): Remove variables err_procs, err_ttys, err_ttys_by_cttyid and err_users. Use hurd_ihash_init instead of ihash_create. Call hurd_ihash_set_cleanup and the hurd_ihash_cleanup_t type instead of ihash_set_cleanup. (ps_context_free): Call hurd_ihash_destroy instead of ihash_free. (lookup): Call hurd_ihash_find instead ihash_find, hurd_ihash_add instead ihash_add. (ps_context_find_proc_stat): Take pointer of hash object. (ps_context_find_tty): Likewise. (ps_context_find_tty_by_cttyid): Likewise. (ps_context_find_user): Likewise. libpthread/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * sysdeps/hurd/pt-key.h (PTHREAD_KEY_MEMBERS): Change type of THREAD_SPECIFICS to hurd_ihash_t. * sysdeps/hurd/pt-setspecific.c (pthread_setspecific): Call hurd_ihash_create instead ihash_create, and hurd_ihash_add instead ihash_add. * sysdeps/hurd/pt-getspecific.c (pthread_getspecific): Call hurd_ihash_find instead of ihash_find. * sysdeps/hurd/pt-destroy-specific.c (__pthread_destroy_specific): Call hurd_ihash_find instead of ihash_find, hurd_ihash_remove instead of ihash_remove, and hurd_ihash_free instead of ihash_free. proc/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * proc.h: Include <hurd/ihash.h>. (struct proc): Change type of members p_pidhashloc and p_taskhashloc to hurd_ihash_locp_t. (struct pgrp): Likewise for pg_hashloc. (struct session): Likewise for s_hashloc. * hash.c: Change type of pghash, pidhash, taskhash and sidhash to struct hurd_ihash and initialize them with HURD_IHASH_INITIALIZER. Include stddef.h. (pid_find): Call hurd_ihash_find instead ihash_find. (pid_find_allow_zombie): Likewise. (task_find): Likewise. (task_find_nocreate): Likewise. (pgrp_find): Likewise. (session_find): Likewise. (add_proc_to_hash): Call hurd_ihash_add instead ihash_add. (add_pgrp_to_hash): Likewise. (add_session_to_hash): Likewise. (remove_pgrp_from_hash): Call hurd_ihash_locp_remove instead ihash_locp_remove, and provide hash table pointer. (remove_proc_from_hash): Likewise. (remove_session_from_hash): Likewise. (prociterate): Use HURD_IHASH_ITERATE instead ihash_iterate. trans/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * fakeroot.c: Include <stddef.h>. (struct netnode): Change type of member idport_locp to hurd_ihash_locp_t. (idport_ihash): Change type to struct hurd_ihash and initialize with HURD_IHASH_INITIALIZER. (new_node): Call hurd_ihash_add instead of ihash_add. (netfs_node_norefs): Call hrd_ihash_locp_remove instead ihash_locp_remove. (netfs_S_dir_lookup): Call hurd_ihash_find instead ihash_find. utils/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * rpctrace.c: Include <stddef.h>. (struct traced_info): Change type of LOCP to hurd_ihash_locp_t. (msgid_ihash): Change type to struct hurd_ihash, and initialize with HURD_IHASH_INITIALIZER, don't set cleanup here. (traced_names): Likewise. (main): Call hurd_ihash_set_cleanup for msgid_ihash. Don't create traced_names. (parse_msgid_list): Call hurd_ihash_add instead ihash_add. (new_send_wrapper): Likewise. (msgid_info): Likewise. Call hurd_ihash_find instead ihash_find. (rewrite_right): Likewise. (traced_dropweak): Call hurd_ihash_locp_remove instead ihash_locp_remove.
2002-05-132002-05-13 Roland McGrath <roland@frob.com>Roland McGrath
* ps.h (proc_stat_state_tags): Make decl extern, not common.
2002-05-082002-05-07 Roland McGrath <roland@frob.com>Roland McGrath
* 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.
2001-12-312001-12-31 Roland McGrath <roland@frob.com>Roland McGrath
* host.c (ps_get_host): Use mach_port_t instead of host_t. * ps.h: Update decl.
2001-03-312001-03-29 Neal H Walfield <neal@cs.uml.edu>Roland McGrath
* host.c: Fix comments. (ps_host_basic_info): Make INITIALIZED static; otherwise we never cache BUF. Do not initalize static variables to 0. (ps_host_sched_info): Likewise. * ps.h: Doc fix.
1999-06-021999-06-02 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* 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.
1996-10-08(struct ps):Miles Bader
Add INAPP field. (struct ps_fmt): Add ERROR field, and rename INVAL to INAPP.
1996-06-27(struct ps_fmt): Add SRC_LEN field.Miles Bader
(proc_stat_list_clone, ps_fmt_clone): New declarations.
1996-06-03(struct proc_stat): Add PROC_INFO_VM_ALLOCED, THREAD_WAITS_VM_ALLOCED, andMiles Bader
ARGS_VM_ALLOCED fields.
1996-06-02(struct ps_fmt_specs): The EXPANSIONS field now points to a structMiles Bader
ps_fmt_spec_block. Delete EXPANSIONS_ALLOCED field.
1996-05-29Renumber PSTAT_ values to remove dup.Miles Bader
1996-05-13(PSTAT_THREAD_WAITS): New macro.Miles Bader
1996-05-07(ps_user_uname_create, ps_user_passwd_create): New declarations.Miles Bader
(ps_fmt_set_output_width): New declaration. (struct ps_fmt_spec): Add precision & flags fields. Change args to OUTPUT_FN. (struct ps_fmt_field): Add precision & flags fields. (ps_fmt_squash): Call FN on the field, not the spec. (ps_fmt_create, ps_fmt_creation_error): Add POSIX arg. (PS_FMT_FIELD_AT_MOD, PS_FMT_FIELD_COLON_MOD, PS_FMT_FIELD_KEEP, PS_FMT_FIELD_UPCASE_TITLE): New macros. (struct proc_stat): Remove exec_flags field. (PSTAT_EXEC_FLAGS): Macro removed.
1996-05-02(ps_fmt_creation_error): new declaration.Miles Bader
1996-04-23(PSTAT_STATE_P_ATTRS): Fix names of individual flags.Miles Bader
1996-03-26(struct ps_fmt_specs): Add EXPANSIONS & EXPANSIONS_ALLOCED.Miles Bader
Get rid of mega typedefs, and just use structure pointers like other hurd libraries. Other misc cleanups.
1996-02-15(ps_alive_filter): New declaration.Miles Bader
(proc_stat_list_add_pids, proc_stat_list_add_pid, proc_stat_list_add_all, proc_stat_list_add_login_coll, proc_stat_list_add_session, proc_stat_list_add_pgrp): Update declarations.
1996-02-13(struct proc_stat): Add thread_wait, thread_waits, & thread_waits_len fields.Miles Bader
(PSTAT_THREAD_WAIT): Renamed from PSTAT_THREAD_RPC. (proc_stat_thread_wait): New macro. (ps_stream_write_trunc_field): New declaration.
1996-02-09(ps_getter_t, ps_filter_t, struct ps_filter, ps_not_leader_filter,Miles Bader
ps_ctty_filter, ps_unorphaned_filter, ps_parent_filter, ps_std_fmt_specs): Make const.
1996-01-19(struct ps_user_hooks): New structure.Miles Bader
(PSTAT_HOOK, PSTAT_USER_BASE, PSTAT_USER_MASK): New macros. (struct ps_context): Add USER_HOOKS field. (struct ps_fmt_spec): Add TITLE field. Renamed DEFAULT_WIDTH field to WIDTH, and move to after TITLE. (ps_fmt_spec_width): Renamed from ps_fmt_spec_default_width(). (ps_fmt_spec_title): New macro. (struct ps_fmt): Add INVAL field. (ps_fmt_inval): New macro. (ps_fmt_specs_t): New typedef. (struct ps_fmt_specs): New structure. (ps_std_fmt_specs): Now of type struct ps_fmt_specs. (ps_fmt_specs_find): Renamed from find_ps_fmt_spec; now uses a struct ps_fmt_specs instead of an array of specs. (ps_fmt_create): Now takes a ps_fmt_specs_t structure instead of an array of specs. (struct proc_stat): Add failed and hook fields.
1995-12-20(proc_stat_owner_uid): New macro.Miles Bader
(PSTAT_OWNER_UID): New macro. (struct proc_stat): Add owner_uid field. (ps_not_leader_filter): Renamed from ps_not_sess_leader_filter.
1995-11-20(ps_fmt_write_titles, ps_fmt_write_proc_stat, proc_stat_list_fmt,Miles Bader
ps_emit_int, ps_emit_nz_int, ps_emit_priority, ps_emit_percent, ps_emit_num_blocks, ps_emit_nice_int, ps_emit_nice_seconds, ps_emit_seconds, ps_emit_uid, ps_emit_uname, ps_emit_string0, ps_emit_string, ps_emit_tty_name, ps_emit_state, ps_stream_write, ps_stream_space, ps_stream_pad, ps_stream_newline, ps_stream_write_field, ps_stream_write_int_field): Use new STREAM parameter instead of old one and count. (ps_stream_write): Renamed from ps_write_string. (ps_stream_space): Renamed from ps_write_spaces. (ps_stream_pad): Renamed from ps_write_padding. (ps_stream_write_field): Renamed from ps_write_field. (ps_stream_write_int_field): Renamed from ps_write_int_field. (ps_stream_newline): New declaration.
1995-11-03(PSTAT_STATE_P_LOGINLDR, PSTAT_STATE_P_WAIT, PSTAT_STATE_P_GETMSG): New flags.Miles Bader
(proc_stat_num_threads): Use the num_threads field. (proc_stat_thread_sched_info, proc_stat_thread_basic_info): Don't take the address, now that the fields used are pointers themselves. (proc_stat_thread_rpc, proc_stat_task_basic_info): New macros. (proc_stat_proc_info): Renamed from proc_stat_info. (PSTAT_PROC_INFO): Renamed from PSTAT_INFO. (PSTAT_TASK_BASIC, PSTAT_THREAD_BASIC, PSTAT_THREAD_SCHED, PSTAT_THREAD_RPC): New macros. (struct proc_stat): info & info_len --> proc_info & proc_info_len. Add the num_threads, task_basic_info, and thread_rpc fields. thread_basic_info & thread_sched_info are now pointers.
1995-08-25(ps_std_fmt_specs): Declare extern.Miles Bader
1995-08-19(PSTAT_STATE_*): All proc state flags reorganized and renamed toMiles Bader
PSTAT_STATE_P_* for process-global bits, and PSTAT_STATE_T_* for per-thread bits.
1995-07-08Include hurd/ihash.h instead of ihash.h.Miles Bader
1995-05-31(ps_own_filter, ps_not_sess_leader_filter, ps_ctty_filter,Miles Bader
ps_unorphaned_filter, ps_parent_filter): Declare these as extern so that the linker will bring in the initialized version (it's not doing so otherwise may be a bug).
1995-05-03Add the nominal_fn field to struct ps_fmt_spec, which will be used to decideMiles Bader
whether values are `unexciting'. Add entries for proc_stat_list_for_each and proc_stat_list_spec_nominal. Rename ps_fmt_squash to ps_fmt_squash_flags.
1995-05-02(struct proc_stat): Add the suspend_count field, along withMiles Bader
PSTAT_SUSPEND_COUNT, and proc_stat_suspend_count(ps).
1995-05-02Replace PSTAT_STATE_EXECED with PSTAT_STATE_FORKED; we want to the flags markMiles Bader
exceptional conditions, and this is rarer.
1995-04-07Add decls for proc_stat_list_add_pgrp & ps_tty_short_name.Miles Bader
Tighten up types used (i.e., don't use int for everything).
1995-04-05Add the PSTAT_NO_MSGPORT flag, which when set disables any use of theMiles Bader
process's message port.
1995-03-28Add the exec_flags field to the proc_stat structure, and addMiles Bader
PSTAT_STATE_TRACED.
1995-03-21* ps.h: Include <errno.h>.Michael I. Bushnell
(ps_get_host, ps_host_basic_info, ps_host_sched_info, ps_host_load_info): Copied here from pshost.h. (ps_write_string, ps_write_spaces, ps_write_padding, ps_write_field, ps_write_int_field): Copied here from pswrite.h
1995-03-14Added the new types ps_context_t, ps_user_t, and ps_tty_t.Miles Bader
proc_stat_list_t's and proc_stat_t's point to a ps_context_t now instead of directly to the proc 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. Add the inverse of proc_stat_list_add_threads, proc_stat_list_remove_threads.
1995-03-13Initial revisionMiles Bader