FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_compat.h"
#include "opt_ddb.h"
#include "opt_kdtrace.h"
#include "opt_ktrace.h"
#include "opt_kstack_pages.h"
#include "opt_stack.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/elf.h>
#include <sys/exec.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/loginclass.h>
#include <sys/malloc.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/ptrace.h>
#include <sys/refcount.h>
#include <sys/resourcevar.h>
#include <sys/sbuf.h>
#include <sys/sysent.h>
#include <sys/sched.h>
#include <sys/smp.h>
#include <sys/stack.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/filedesc.h>
#include <sys/tty.h>
#include <sys/signalvar.h>
#include <sys/sdt.h>
#include <sys/sx.h>
#include <sys/user.h>
#include <sys/jail.h>
#include <sys/vnode.h>
#include <sys/eventhandler.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_extern.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/uma.h>
Go to the source code of this file.
Macros | |
#define | PROC_AUXV_MAX 256 /* Safety limit on auxv size. */ |
#define | GET_PS_STRINGS_CHUNK_SZ 256 /* Chunk size (bytes) for ps_strings operations. */ |
Enumerations | |
enum | proc_vector_type { PROC_ARG, PROC_ENV, PROC_AUX } |
Functions | |
__FBSDID ("$BSDSUniX$") | |
SDT_PROVIDER_DEFINE (proc) | |
SDT_PROBE_DEFINE4 (proc, kernel, ctor, entry,"struct proc *","int","void *","int") | |
SDT_PROBE_DEFINE4 (proc, kernel, ctor, return,"struct proc *","int","void *","int") | |
SDT_PROBE_DEFINE4 (proc, kernel, dtor, entry,"struct proc *","int","void *","struct thread *") | |
SDT_PROBE_DEFINE3 (proc, kernel, dtor, return,"struct proc *","int","void *") | |
SDT_PROBE_DEFINE3 (proc, kernel, init, entry,"struct proc *","int","int") | |
SDT_PROBE_DEFINE3 (proc, kernel, init, return,"struct proc *","int","int") | |
MALLOC_DEFINE (M_PGRP,"pgrp","process group header") | |
MALLOC_DEFINE (M_SESSION,"session","session header") | |
static | MALLOC_DEFINE (M_PROC,"proc","Proc structures") |
MALLOC_DEFINE (M_SUBPROC,"subproc","Proc sub-structures") | |
static void | doenterpgrp (struct proc *, struct pgrp *) |
static void | orphanpg (struct pgrp *pg) |
static void | fill_kinfo_aggregate (struct proc *p, struct kinfo_proc *kp) |
static void | fill_kinfo_proc_only (struct proc *p, struct kinfo_proc *kp) |
static void | fill_kinfo_thread (struct thread *td, struct kinfo_proc *kp, int preferthread) |
static void | pgadjustjobc (struct pgrp *pgrp, int entering) |
static void | pgdelete (struct pgrp *) |
static int | proc_ctor (void *mem, int size, void *arg, int flags) |
static void | proc_dtor (void *mem, int size, void *arg) |
static int | proc_init (void *mem, int size, int flags) |
static void | proc_fini (void *mem, int size) |
static void | pargs_free (struct pargs *pa) |
static struct proc * | zpfind_locked (pid_t pid) |
SYSCTL_INT (_kern, OID_AUTO, kstack_pages, CTLFLAG_RD,&kstack_pages, 0,"Kernel stack size in pages") | |
SYSCTL_INT (_kern, OID_AUTO, proc_vmmap_skip_resident_count, CTLFLAG_RW,&vmmap_skip_res_cnt, 0,"Skip calculation of the pages resident count in kern.proc.vmmap") | |
CTASSERT (sizeof(struct kinfo_proc)==KINFO_PROC_SIZE) | |
void | procinit () |
int | inferior (struct proc *p) |
struct proc * | pfind_locked (pid_t pid) |
struct proc * | pfind (pid_t pid) |
static struct proc * | pfind_tid_locked (pid_t tid) |
struct pgrp * | pgfind (pid_t pgid) |
int | pget (pid_t pid, int flags, struct proc **pp) |
int | enterpgrp (struct proc *p, pid_t pgid, struct pgrp *pgrp, struct session *sess) |
int | enterthispgrp (struct proc *p, struct pgrp *pgrp) |
int | leavepgrp (struct proc *p) |
void | fixjobc (struct proc *p, struct pgrp *pgrp, int entering) |
void | sess_hold (struct session *s) |
void | sess_release (struct session *s) |
void | fill_kinfo_proc (struct proc *p, struct kinfo_proc *kp) |
struct pstats * | pstats_alloc (void) |
void | pstats_fork (struct pstats *src, struct pstats *dst) |
void | pstats_free (struct pstats *ps) |
struct proc * | zpfind (pid_t pid) |
int | kern_proc_out (struct proc *p, struct sbuf *sb, int flags) |
static int | sysctl_out_proc (struct proc *p, struct sysctl_req *req, int flags, int doingzomb) |
static int | sysctl_kern_proc (SYSCTL_HANDLER_ARGS) |
struct pargs * | pargs_alloc (int len) |
void | pargs_hold (struct pargs *pa) |
void | pargs_drop (struct pargs *pa) |
static int | proc_read_mem (struct thread *td, struct proc *p, vm_offset_t offset, void *buf, size_t len) |
static int | proc_read_string (struct thread *td, struct proc *p, const char *sptr, char *buf, size_t len) |
static int | get_proc_vector (struct thread *td, struct proc *p, char ***proc_vectorp, size_t *vsizep, enum proc_vector_type type) |
static int | get_ps_strings (struct thread *td, struct proc *p, struct sbuf *sb, enum proc_vector_type type) |
int | proc_getargv (struct thread *td, struct proc *p, struct sbuf *sb) |
int | proc_getenvv (struct thread *td, struct proc *p, struct sbuf *sb) |
int | proc_getauxv (struct thread *td, struct proc *p, struct sbuf *sb) |
static int | sysctl_kern_proc_args (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_env (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_auxv (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_pathname (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_sv_name (SYSCTL_HANDLER_ARGS) |
int | kern_proc_vmmap_out (struct proc *p, struct sbuf *sb) |
static int | sysctl_kern_proc_vmmap (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_groups (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_rlimit (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_ps_strings (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_umask (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_osrel (SYSCTL_HANDLER_ARGS) |
static int | sysctl_kern_proc_sigtramp (SYSCTL_HANDLER_ARGS) |
SYSCTL_NODE (_kern, KERN_PROC, proc, CTLFLAG_RD, 0,"Process table") | |
SYSCTL_PROC (_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT|CTLFLAG_MPSAFE, 0, 0, sysctl_kern_proc,"S,proc","Return entire process table") | |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_GID, gid, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_PGRP, pgrp, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_RGID, rgid, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_SESSION, sid, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_TTY, tty, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_UID, uid, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_RUID, ruid, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_PID, pid, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_PROC, proc, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Return process table, no threads") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_ARGS, args, CTLFLAG_RW|CTLFLAG_ANYBODY|CTLFLAG_MPSAFE, sysctl_kern_proc_args,"Process argument list") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_ENV, env, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_env,"Process environment") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_AUXV, auxv, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_auxv,"Process ELF auxiliary vector") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_PATHNAME, pathname, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_pathname,"Process executable path") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_SV_NAME, sv_name, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_sv_name,"Process syscall vector name (ABI type)") |
static | SYSCTL_NODE (_kern_proc,(KERN_PROC_GID|KERN_PROC_INC_THREAD), gid_td, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc,(KERN_PROC_PGRP|KERN_PROC_INC_THREAD), pgrp_td, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc,(KERN_PROC_RGID|KERN_PROC_INC_THREAD), rgid_td, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc,(KERN_PROC_SESSION|KERN_PROC_INC_THREAD), sid_td, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc,(KERN_PROC_TTY|KERN_PROC_INC_THREAD), tty_td, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc,(KERN_PROC_UID|KERN_PROC_INC_THREAD), uid_td, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc,(KERN_PROC_RUID|KERN_PROC_INC_THREAD), ruid_td, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc,(KERN_PROC_PID|KERN_PROC_INC_THREAD), pid_td, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Process table") |
static | SYSCTL_NODE (_kern_proc,(KERN_PROC_PROC|KERN_PROC_INC_THREAD), proc_td, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc,"Return process table, no threads") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_VMMAP, vmmap, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_vmmap,"Process vm map entries") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_GROUPS, groups, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_groups,"Process groups") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_RLIMIT, rlimit, CTLFLAG_RW|CTLFLAG_ANYBODY|CTLFLAG_MPSAFE, sysctl_kern_proc_rlimit,"Process resource limits") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_PS_STRINGS, ps_strings, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_ps_strings,"Process ps_strings location") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_UMASK, umask, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_umask,"Process umask") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_OSREL, osrel, CTLFLAG_RW|CTLFLAG_ANYBODY|CTLFLAG_MPSAFE, sysctl_kern_proc_osrel,"Process binary osreldate") |
static | SYSCTL_NODE (_kern_proc, KERN_PROC_SIGTRAMP, sigtramp, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_sigtramp,"Process signal trampoline location") |
Variables | |
struct pidhashhead * | pidhashtbl |
u_long | pidhash |
struct pgrphashhead * | pgrphashtbl |
u_long | pgrphash |
struct proclist | allproc |
struct proclist | zombproc |
struct sx | allproc_lock |
struct sx | proctree_lock |
struct mtx | ppeers_lock |
uma_zone_t | proc_zone |
int | kstack_pages = KSTACK_PAGES |
static int | vmmap_skip_res_cnt = 0 |
#define GET_PS_STRINGS_CHUNK_SZ 256 /* Chunk size (bytes) for ps_strings operations. */ |
Definition at line 1693 of file kern_proc.c.
Referenced by get_ps_strings(), sysctl_kern_proc_args(), sysctl_kern_proc_auxv(), and sysctl_kern_proc_env().
#define PROC_AUXV_MAX 256 /* Safety limit on auxv size. */ |
Definition at line 1520 of file kern_proc.c.
Referenced by get_proc_vector().
enum proc_vector_type |
Enumerator | |
---|---|
PROC_ARG | |
PROC_ENV | |
PROC_AUX |
Definition at line 1522 of file kern_proc.c.
__FBSDID | ( | "$BSDSUniX$" | ) |
CTASSERT | ( | sizeof(struct kinfo_proc) | = =KINFO_PROC_SIZE | ) |
|
static |
Definition at line 515 of file kern_proc.c.
References fixjobc(), pgdelete(), and proctree_lock.
Referenced by enterpgrp(), and enterthispgrp().
int enterpgrp | ( | struct proc * | p, |
pid_t | pgid, | ||
struct pgrp * | pgrp, | ||
struct session * | sess | ||
) |
Definition at line 423 of file kern_proc.c.
References doenterpgrp(), mtx_init(), pgfind(), proctree_lock, and sess_hold().
Referenced by sys_setpgid(), and sys_setsid().
int enterthispgrp | ( | struct proc * | p, |
struct pgrp * | pgrp | ||
) |
Definition at line 488 of file kern_proc.c.
References doenterpgrp(), and proctree_lock.
Referenced by sys_setpgid().
|
static |
Definition at line 766 of file kern_proc.c.
References sched_pctcpu().
Referenced by fill_kinfo_proc().
void fill_kinfo_proc | ( | struct proc * | p, |
struct kinfo_proc * | kp | ||
) |
Definition at line 1019 of file kern_proc.c.
References fill_kinfo_aggregate(), fill_kinfo_proc_only(), and fill_kinfo_thread().
Referenced by kern_proc_out().
|
static |
Definition at line 788 of file kern_proc.c.
References boottime, calccru(), calcru(), cputick2usec(), hz, jailed(), rufetch(), ticks, timevaladd(), and tty_udev().
Referenced by fill_kinfo_proc().
|
static |
Definition at line 935 of file kern_proc.c.
References cputick2usec(), hz, rufetchtd(), sched_pctcpu(), and ticks.
Referenced by fill_kinfo_proc(), and kern_proc_out().
void fixjobc | ( | struct proc * | p, |
struct pgrp * | pgrp, | ||
int | entering | ||
) |
Definition at line 637 of file kern_proc.c.
References pgadjustjobc(), and proctree_lock.
Referenced by doenterpgrp(), and exit1().
|
static |
Definition at line 1603 of file kern_proc.c.
References free(), malloc(), PROC_ARG, PROC_AUX, PROC_AUXV_MAX, PROC_ENV, and proc_read_mem().
Referenced by get_ps_strings(), and proc_getauxv().
|
static |
Definition at line 1696 of file kern_proc.c.
References free(), get_proc_vector(), GET_PS_STRINGS_CHUNK_SZ, proc_read_string(), and sbuf_bcat().
Referenced by proc_getargv(), and proc_getenvv().
int inferior | ( | struct proc * | p | ) |
Definition at line 266 of file kern_proc.c.
References proc_realparent(), and proctree_lock.
Referenced by sys_setpgid().
int kern_proc_out | ( | struct proc * | p, |
struct sbuf * | sb, | ||
int | flags | ||
) |
Definition at line 1189 of file kern_proc.c.
References fill_kinfo_proc(), fill_kinfo_thread(), and sbuf_bcat().
Referenced by note_procstat_proc(), and sysctl_out_proc().
int kern_proc_vmmap_out | ( | struct proc * | p, |
struct sbuf * | sb | ||
) |
Definition at line 2148 of file kern_proc.c.
References free(), malloc(), sbuf_bcat(), vmmap_skip_res_cnt, vn_fullpath(), vntype_to_kinfo(), vput(), and vref().
Referenced by note_procstat_vmmap(), and sysctl_kern_proc_vmmap().
int leavepgrp | ( | struct proc * | p | ) |
Definition at line 554 of file kern_proc.c.
References pgdelete(), and proctree_lock.
Referenced by proc_reap().
MALLOC_DEFINE | ( | M_PGRP | , |
"pgrp" | , | ||
"process group header" | |||
) |
MALLOC_DEFINE | ( | M_SESSION | , |
"session" | , | ||
"session header" | |||
) |
|
static |
MALLOC_DEFINE | ( | M_SUBPROC | , |
"subproc" | , | ||
"Proc sub-structures" | |||
) |
|
static |
Definition at line 685 of file kern_proc.c.
References kern_psignal().
Referenced by pgadjustjobc().
struct pargs* pargs_alloc | ( | int | len | ) |
Definition at line 1436 of file kern_proc.c.
References malloc().
Referenced by do_execve(), and sysctl_kern_proc_args().
void pargs_drop | ( | struct pargs * | pa | ) |
Definition at line 1464 of file kern_proc.c.
References pargs_free().
Referenced by do_execve(), proc_reap(), and sysctl_kern_proc_args().
|
static |
Definition at line 1448 of file kern_proc.c.
References free().
Referenced by pargs_drop(), and sysctl_kern_proc_args().
void pargs_hold | ( | struct pargs * | pa | ) |
Definition at line 1455 of file kern_proc.c.
Referenced by do_fork(), and sysctl_kern_proc_args().
struct proc* pfind | ( | pid_t | pid | ) |
Definition at line 304 of file kern_proc.c.
References allproc_lock, and pfind_locked().
Referenced by cpuset_which(), filt_procattach(), fsetown(), kern_procctl(), kern_ptrace(), sys_getpgid(), sys_getpriority(), sys_getsid(), sys_kill(), sys_ktrace(), sys_rtprio(), sys_setpgid(), sys_setpriority(), sys_sigqueue(), sys_thr_kill2(), and sysctl_out_proc().
struct proc* pfind_locked | ( | pid_t | pid | ) |
Definition at line 279 of file kern_proc.c.
References allproc_lock.
Referenced by pfind(), and pget().
|
static |
Definition at line 315 of file kern_proc.c.
References allproc_lock.
Referenced by pget().
|
static |
Definition at line 610 of file kern_proc.c.
References orphanpg().
Referenced by fixjobc().
|
static |
Definition at line 576 of file kern_proc.c.
References free(), funsetownlst(), mtx_destroy(), proctree_lock, sess_release(), and tty_rel_pgrp().
Referenced by doenterpgrp(), and leavepgrp().
int pget | ( | pid_t | pid, |
int | flags, | ||
struct proc ** | pp | ||
) |
Definition at line 362 of file kern_proc.c.
References allproc_lock, p_candebug(), p_cansee(), pfind_locked(), pfind_tid_locked(), and zpfind_locked().
Referenced by get_cputime(), kern_clock_getcpuclockid2(), sysctl_kern_proc(), sysctl_kern_proc_args(), sysctl_kern_proc_auxv(), sysctl_kern_proc_env(), sysctl_kern_proc_filedesc(), sysctl_kern_proc_groups(), sysctl_kern_proc_osrel(), sysctl_kern_proc_pathname(), sysctl_kern_proc_ps_strings(), sysctl_kern_proc_rlimit(), sysctl_kern_proc_sigtramp(), sysctl_kern_proc_sv_name(), sysctl_kern_proc_umask(), and sysctl_kern_proc_vmmap().
struct pgrp* pgfind | ( | pid_t | pgid | ) |
Definition at line 342 of file kern_proc.c.
References proctree_lock.
Referenced by enterpgrp(), fsetown(), gsignal(), kern_procctl(), killpg1(), sys_getpriority(), sys_ktrace(), sys_setpgid(), sys_setpriority(), sys_setsid(), and tty_generic_ioctl().
|
static |
Definition at line 178 of file kern_proc.c.
Referenced by procinit().
|
static |
Definition at line 193 of file kern_proc.c.
Referenced by procinit().
|
static |
Definition at line 245 of file kern_proc.c.
References ksiginfo_free(), mtx_destroy(), panic(), pstats_free(), and thread_free().
Referenced by procinit().
int proc_getargv | ( | struct thread * | td, |
struct proc * | p, | ||
struct sbuf * | sb | ||
) |
Definition at line 1744 of file kern_proc.c.
References get_ps_strings(), and PROC_ARG.
Referenced by sysctl_kern_proc_args().
int proc_getauxv | ( | struct thread * | td, |
struct proc * | p, | ||
struct sbuf * | sb | ||
) |
Definition at line 1758 of file kern_proc.c.
References free(), get_proc_vector(), PROC_AUX, and sbuf_bcat().
Referenced by note_procstat_auxv(), and sysctl_kern_proc_auxv().
int proc_getenvv | ( | struct thread * | td, |
struct proc * | p, | ||
struct sbuf * | sb | ||
) |
Definition at line 1751 of file kern_proc.c.
References get_ps_strings(), and PROC_ENV.
Referenced by sysctl_kern_proc_env().
|
static |
Definition at line 221 of file kern_proc.c.
References cv_init(), mtx_init(), and pstats_alloc().
Referenced by procinit().
|
static |
Definition at line 1474 of file kern_proc.c.
References proc_rwmem().
Referenced by get_proc_vector(), and proc_read_string().
|
static |
Definition at line 1494 of file kern_proc.c.
References proc_read_mem().
Referenced by get_ps_strings().
void procinit | ( | ) |
Definition at line 158 of file kern_proc.c.
References allproc, allproc_lock, hashinit(), maxproc, mtx_init(), pgrphash, pgrphashtbl, pidhash, pidhashtbl, ppeers_lock, proc_ctor(), proc_dtor(), proc_fini(), proc_init(), proc_zone, proctree_lock, sched_sizeof_proc(), uihashinit(), and zombproc.
Referenced by proc0_init().
struct pstats* pstats_alloc | ( | void | ) |
Definition at line 1030 of file kern_proc.c.
References malloc().
Referenced by proc0_init(), and proc_init().
void pstats_fork | ( | struct pstats * | src, |
struct pstats * | dst | ||
) |
Definition at line 1040 of file kern_proc.c.
Referenced by do_fork().
void pstats_free | ( | struct pstats * | ps | ) |
Definition at line 1050 of file kern_proc.c.
References free().
Referenced by proc_fini().
SDT_PROBE_DEFINE3 | ( | proc | , |
kernel | , | ||
dtor | , | ||
return | , | ||
"struct proc *" | , | ||
"int" | , | ||
"void *" | |||
) |
SDT_PROBE_DEFINE3 | ( | proc | , |
kernel | , | ||
init | , | ||
entry | , | ||
"struct proc *" | , | ||
"int" | , | ||
"int" | |||
) |
SDT_PROBE_DEFINE3 | ( | proc | , |
kernel | , | ||
init | , | ||
return | , | ||
"struct proc *" | , | ||
"int" | , | ||
"int" | |||
) |
SDT_PROBE_DEFINE4 | ( | proc | , |
kernel | , | ||
ctor | , | ||
entry | , | ||
"struct proc *" | , | ||
"int" | , | ||
"void *" | , | ||
"int" | |||
) |
SDT_PROBE_DEFINE4 | ( | proc | , |
kernel | , | ||
ctor | , | ||
return | , | ||
"struct proc *" | , | ||
"int" | , | ||
"void *" | , | ||
"int" | |||
) |
SDT_PROBE_DEFINE4 | ( | proc | , |
kernel | , | ||
dtor | , | ||
entry | , | ||
"struct proc *" | , | ||
"int" | , | ||
"void *" | , | ||
"struct thread *" | |||
) |
SDT_PROVIDER_DEFINE | ( | proc | ) |
void sess_hold | ( | struct session * | s | ) |
Definition at line 709 of file kern_proc.c.
Referenced by enterpgrp(), and tprintf().
void sess_release | ( | struct session * | s | ) |
Definition at line 716 of file kern_proc.c.
References free(), mtx_destroy(), and tty_rel_sess().
Referenced by pgdelete(), and tprintf().
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
kstack_pages | , | ||
CTLFLAG_RD | , | ||
& | kstack_pages, | ||
0 | , | ||
"Kernel stack size in pages" | |||
) |
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
proc_vmmap_skip_resident_count | , | ||
CTLFLAG_RW | , | ||
& | vmmap_skip_res_cnt, | ||
0 | , | ||
"Skip calculation of the pages resident count in kern.proc.vmmap" | |||
) |
|
static |
Definition at line 1266 of file kern_proc.c.
References allproc, allproc_lock, name, p_cansee(), pget(), sysctl_out_proc(), sysctl_wire_old_buffer(), tty_udev(), and zombproc.
|
static |
Definition at line 1785 of file kern_proc.c.
References GET_PS_STRINGS_CHUNK_SZ, name, pargs_alloc(), pargs_drop(), pargs_free(), pargs_hold(), pget(), proc_getargv(), ps_arg_cache_limit, sbuf_delete(), sbuf_finish(), and sbuf_new_for_sysctl().
|
static |
Definition at line 1878 of file kern_proc.c.
References GET_PS_STRINGS_CHUNK_SZ, name, pget(), proc_getauxv(), sbuf_delete(), sbuf_finish(), and sbuf_new_for_sysctl().
|
static |
Definition at line 1846 of file kern_proc.c.
References GET_PS_STRINGS_CHUNK_SZ, name, pget(), proc_getenvv(), sbuf_delete(), sbuf_finish(), and sbuf_new_for_sysctl().
|
static |
Definition at line 2453 of file kern_proc.c.
References crfree(), crhold(), and pget().
|
static |
Definition at line 2613 of file kern_proc.c.
References pget().
|
static |
Definition at line 1909 of file kern_proc.c.
References free(), pget(), vn_fullpath(), vref(), and vrele().
|
static |
Definition at line 2545 of file kern_proc.c.
References pget().
|
static |
Definition at line 2486 of file kern_proc.c.
References kern_proc_setrlimit(), lim_rlimit(), and pget().
|
static |
Definition at line 2655 of file kern_proc.c.
References pget().
|
static |
Definition at line 1949 of file kern_proc.c.
References name, pget(), and sysctl_handle_string().
|
static |
Definition at line 2585 of file kern_proc.c.
References pget().
|
static |
Definition at line 2337 of file kern_proc.c.
References kern_proc_vmmap_out(), name, pget(), sbuf_delete(), sbuf_finish(), and sbuf_new_for_sysctl().
SYSCTL_NODE | ( | _kern | , |
KERN_PROC | , | ||
proc | , | ||
CTLFLAG_RD | , | ||
0 | , | ||
"Process table" | |||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 1230 of file kern_proc.c.
References kern_proc_out(), pfind(), sbuf_delete(), sbuf_finish(), sbuf_new_for_sysctl(), and zpfind().
Referenced by sysctl_kern_proc().
SYSCTL_PROC | ( | _kern_proc | , |
KERN_PROC_ALL | , | ||
all | , | ||
CTLFLAG_RD|CTLTYPE_STRUCT| | CTLFLAG_MPSAFE, | ||
0 | , | ||
0 | , | ||
sysctl_kern_proc | , | ||
" | S, | ||
proc" | , | ||
"Return entire process table" | |||
) |
struct proc* zpfind | ( | pid_t | pid | ) |
Definition at line 1075 of file kern_proc.c.
References allproc_lock, and zpfind_locked().
Referenced by filt_procattach(), sys_kill(), sys_sigqueue(), and sysctl_out_proc().
|
static |
Definition at line 1057 of file kern_proc.c.
References allproc_lock, and zombproc.
Referenced by pget(), and zpfind().
struct proclist allproc |
Definition at line 134 of file kern_proc.c.
Referenced by do_fork(), fork_findpid(), kdb_thr_first(), kdb_thr_from_pid(), prison_remove_one(), proc0_init(), procinit(), and sysctl_kern_proc().
struct sx allproc_lock |
Definition at line 136 of file kern_proc.c.
Referenced by brand_inuse(), do_fork(), exit1(), fork1(), fork_findpid(), killpg1(), mountcheckdirs(), pfind(), pfind_locked(), pfind_tid_locked(), pget(), prison_remove_one(), proc0_post(), proc_reap(), procinit(), schedcpu(), sys_getpriority(), sys_ktrace(), sys_setpriority(), sysctl_kern_file(), sysctl_kern_pid_max(), sysctl_kern_proc(), sysctl_kern_randompid(), zpfind(), and zpfind_locked().
int kstack_pages = KSTACK_PAGES |
Definition at line 141 of file kern_proc.c.
u_long pgrphash |
Definition at line 133 of file kern_proc.c.
Referenced by procinit().
struct pgrphashhead* pgrphashtbl |
Definition at line 132 of file kern_proc.c.
Referenced by procinit().
u_long pidhash |
Definition at line 131 of file kern_proc.c.
Referenced by procinit().
struct pidhashhead* pidhashtbl |
Definition at line 130 of file kern_proc.c.
Referenced by procinit().
struct mtx ppeers_lock |
Definition at line 138 of file kern_proc.c.
Referenced by do_fork(), exit1(), and procinit().
uma_zone_t proc_zone |
Definition at line 139 of file kern_proc.c.
Referenced by fork1(), proc_reap(), and procinit().
struct sx proctree_lock |
Definition at line 137 of file kern_proc.c.
Referenced by acct_process(), clear_orphan(), ctty_clone(), do_fork(), doenterpgrp(), enterpgrp(), enterthispgrp(), exit1(), fixjobc(), fork1(), fork_findpid(), fork_return(), fsetown(), gsignal(), inferior(), kern_procctl(), kern_ptrace(), kern_wait6(), killpg1(), kproc_exit(), leavepgrp(), pgdelete(), pgfind(), proc_realparent(), proc_reap(), proc_reparent(), proc_to_reap(), procinit(), protect_setchildren(), sys_getpriority(), sys_ktrace(), sys_setpgid(), sys_setpriority(), sys_setsid(), sysctl_kern_pid_max(), tprintf(), tty_generic_ioctl(), and uprintf().
|
static |
Definition at line 144 of file kern_proc.c.
Referenced by kern_proc_vmmap_out().
struct proclist zombproc |
Definition at line 135 of file kern_proc.c.
Referenced by exit1(), fork_findpid(), procinit(), sysctl_kern_proc(), and zpfind_locked().