/freebsd/usr.bin/procstat/ |
H A D | procstat.h | 55 void kinfo_proc_sort(struct kinfo_proc *kipp, int count); 56 const char * kinfo_proc_thread_name(const struct kinfo_proc *kipp); 58 void procstat_advlocks(struct procstat *prstat, struct kinfo_proc *kipp); 59 void procstat_args(struct procstat *prstat, struct kinfo_proc *kipp); 60 void procstat_auxv(struct procstat *prstat, struct kinfo_proc *kipp); 61 void procstat_basic(struct procstat *prstat, struct kinfo_proc *kipp); 62 void procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp); 63 void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); 64 void procstat_cs(struct procstat *prstat, struct kinfo_proc *kipp); 65 void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); [all …]
|
H A D | procstat_threads.c | 44 procstat_threads(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_threads() argument 55 xo_emit("{ek:process_id/%d}", kipp->ki_pid); in procstat_threads() 56 xo_emit("{e:command/%s}", strlen(kipp->ki_comm) ? in procstat_threads() 57 kipp->ki_comm : "-"); in procstat_threads() 61 kipp->ki_pid, &count); in procstat_threads() 66 kipp = &kip[i]; in procstat_threads() 67 asprintf(&threadid, "%d", kipp->ki_tid); in procstat_threads() 72 xo_emit("{dk:process_id/%5d/%d} ", kipp->ki_pid); in procstat_threads() 73 xo_emit("{:thread_id/%6d/%d} ", kipp->ki_tid); in procstat_threads() 74 xo_emit("{d:command/%-19s/%s} ", strlen(kipp->ki_comm) ? in procstat_threads() [all …]
|
H A D | procstat_basic.c | 42 procstat_basic(struct procstat *procstat __unused, struct kinfo_proc *kipp) in procstat_basic() argument 50 xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); in procstat_basic() 51 xo_emit("{:parent_process_id/%5d/%d} ", kipp->ki_ppid); in procstat_basic() 52 xo_emit("{:process_group_id/%5d/%d} ", kipp->ki_pgid); in procstat_basic() 53 xo_emit("{:session_id/%5d/%d} ", kipp->ki_sid); in procstat_basic() 54 xo_emit("{:terminal_session_id/%5d/%d} ", kipp->ki_tsid); in procstat_basic() 55 xo_emit("{:threads/%3d/%d} ", kipp->ki_numthreads); in procstat_basic() 56 xo_emit("{:login/%-8s/%s} ", strlen(kipp->ki_login) ? in procstat_basic() 57 kipp->ki_login : "-"); in procstat_basic() 58 if (kipp->ki_kiflag & KI_LOCKBLOCK) { in procstat_basic() [all …]
|
H A D | procstat_sigs.c | 112 procstat_sigs(struct procstat *prstat __unused, struct kinfo_proc *kipp) in procstat_sigs() argument 120 xo_emit("{ek:process_id/%5d/%d}", kipp->ki_pid); in procstat_sigs() 121 xo_emit("{e:command/%-16s/%s}", kipp->ki_comm); in procstat_sigs() 124 xo_emit("{dk:process_id/%5d/%d} ", kipp->ki_pid); in procstat_sigs() 125 xo_emit("{d:command/%-16s/%s} ", kipp->ki_comm); in procstat_sigs() 128 procstat_print_sig(&kipp->ki_siglist, j, 'P'); in procstat_sigs() 129 procstat_print_sig(&kipp->ki_sigignore, j, 'I'); in procstat_sigs() 130 procstat_print_sig(&kipp->ki_sigcatch, j, 'C'); in procstat_sigs() 138 procstat_threads_sigs(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_threads_sigs() argument 150 kipp->ki_pid, &count); in procstat_threads_sigs() [all …]
|
H A D | procstat_cred.c | 43 struct kinfo_proc *kipp); 46 procstat_cred(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_cred() argument 56 xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); in procstat_cred() 57 xo_emit("{:command/%-16s/%s} ", kipp->ki_comm); in procstat_cred() 58 xo_emit("{:uid/%5d} ", kipp->ki_uid); in procstat_cred() 59 xo_emit("{:ruid/%5d} ", kipp->ki_ruid); in procstat_cred() 60 xo_emit("{:svuid/%5d} ", kipp->ki_svuid); in procstat_cred() 61 xo_emit("{:group/%5d} ", kipp->ki_groups[0]); in procstat_cred() 62 xo_emit("{:rgid/%5d} ", kipp->ki_rgid); in procstat_cred() 63 xo_emit("{:svgid/%5d} ", kipp->ki_svgid); in procstat_cred() [all …]
|
H A D | procstat_rusage.c | 102 print_prefix(struct kinfo_proc *kipp) in print_prefix() argument 105 xo_emit("{d:process_id/%5d/%d} ", kipp->ki_pid); in print_prefix() 107 xo_emit("{d:thread_id/%6d/%d} ", kipp->ki_tid); in print_prefix() 108 xo_emit("{d:command/%-16s/%s} ", kipp->ki_comm); in print_prefix() 112 print_rusage(struct kinfo_proc *kipp) in print_rusage() argument 118 print_prefix(kipp); in print_rusage() 120 format_time(&kipp->ki_rusage.ru_utime)); in print_rusage() 121 print_prefix(kipp); in print_rusage() 123 format_time(&kipp->ki_rusage.ru_stime)); in print_rusage() 126 asprintf(&threadid, "%d", kipp->ki_tid); in print_rusage() [all …]
|
H A D | procstat_cs.c | 44 procstat_cs(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_cs() argument 58 kipp->ki_pid, &count); in procstat_cs() 63 kipp = &kip[i]; in procstat_cs() 64 xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); in procstat_cs() 65 xo_emit("{:thread_id/%6d/%d} ", kipp->ki_tid); in procstat_cs() 66 xo_emit("{:command/%-19s/%s} ", strlen(kipp->ki_comm) ? in procstat_cs() 67 kipp->ki_comm : "-"); in procstat_cs() 69 kinfo_proc_thread_name(kipp)); in procstat_cs() 70 if (kipp->ki_oncpu != 255) in procstat_cs() 71 xo_emit("{:cpu/%3d/%d} ", kipp->ki_oncpu); in procstat_cs() [all …]
|
H A D | procstat_penv.c | 44 procstat_pargs(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_pargs() argument 49 args = procstat_getargv(procstat, kipp, 0); in procstat_pargs() 51 xo_emit("{k:process_id/%d}: {:command/%s/%s}\n", kipp->ki_pid, in procstat_pargs() 52 kipp->ki_comm); in procstat_pargs() 65 procstat_penv(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_penv() argument 70 envs = procstat_getenvv(procstat, kipp, 0); in procstat_penv() 72 xo_emit("{k:process_id/%d}: {:command/%s/%s}\n", kipp->ki_pid, in procstat_penv() 73 kipp->ki_comm); in procstat_penv()
|
H A D | procstat_args.c | 45 procstat_args(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_args() argument 54 args = procstat_getargv(procstat, kipp, 0); in procstat_args() 56 xo_emit("{k:process_id/%5d/%d} {:command/%-16s/%s}", kipp->ki_pid, in procstat_args() 57 kipp->ki_comm); in procstat_args() 72 procstat_env(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_env() argument 81 envs = procstat_getenvv(procstat, kipp, 0); in procstat_env() 83 xo_emit("{k:process_id/%5d/%d} {:command/%-16s/%s}", kipp->ki_pid, in procstat_env() 84 kipp->ki_comm); in procstat_env()
|
H A D | procstat_kstack.c | 165 procstat_kstack(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_kstack() argument 177 kkstp = kkstp_free = procstat_getkstack(procstat, kipp, &kstk_count); in procstat_kstack() 185 KERN_PROC_PID | KERN_PROC_INC_THREAD, kipp->ki_pid, &kip_count); in procstat_kstack() 200 kipp = NULL; in procstat_kstack() 202 kipp = &kip_free[j]; in procstat_kstack() 203 if (kkstp->kkst_tid == kipp->ki_tid) in procstat_kstack() 206 if (kipp == NULL) in procstat_kstack() 209 xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); in procstat_kstack() 211 xo_emit("{:command/%-19s/%s} ", kipp->ki_comm); in procstat_kstack() 213 kinfo_proc_thread_name(kipp)); in procstat_kstack()
|
H A D | procstat_bin.c | 44 procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp) in procstat_bin() argument 53 if (procstat_getpathname(prstat, kipp, pathname, sizeof(pathname)) != 0) in procstat_bin() 57 if (procstat_getosrel(prstat, kipp, &osrel) != 0) in procstat_bin() 60 xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid); in procstat_bin() 61 xo_emit("{:command/%-16s/%s} ", kipp->ki_comm); in procstat_bin()
|
H A D | procstat_rlimit.c | 92 procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp) in procstat_rlimit() argument 101 xo_emit("{ek:process_id/%5d}{e:command/%-16s/%s}", kipp->ki_pid, in procstat_rlimit() 102 kipp->ki_comm); in procstat_rlimit() 104 if (procstat_getrlimit(prstat, kipp, i, &rlimit) == -1) in procstat_rlimit() 107 "{d:rlimit_param/%-16s} ", kipp->ki_pid, kipp->ki_comm, in procstat_rlimit()
|
H A D | procstat_rlimitusage.c | 50 procstat_rlimitusage(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_rlimitusage() argument 59 xo_emit("{ek:process_id/%d}", kipp->ki_pid); in procstat_rlimitusage() 61 resuse = procstat_getrlimitusage(procstat, kipp, &cnt); in procstat_rlimitusage() 67 xo_emit("{dk:process_id/%7d} ", kipp->ki_pid); in procstat_rlimitusage()
|
H A D | procstat_auxv.c | 48 procstat_auxv(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_auxv() argument 58 auxv = procstat_getauxv(procstat, kipp, &count); in procstat_auxv() 61 snprintf(prefix, sizeof(prefix), "%5d %-19s", kipp->ki_pid, in procstat_auxv() 62 kipp->ki_comm); in procstat_auxv() 64 xo_emit("{e:process_id/%5d/%d}{e:command/%-19s/%s}", kipp->ki_pid, in procstat_auxv() 65 kipp->ki_comm); in procstat_auxv()
|
H A D | procstat_pwdx.c | 50 procstat_pwdx(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_pwdx() argument 55 head = procstat_getfiles(procstat, kipp, 0); in procstat_pwdx() 61 xo_emit("{k:process_id/%d}{P:: }", kipp->ki_pid); in procstat_pwdx()
|
H A D | procstat.c | 184 struct kinfo_proc *kipp) in procstat() argument 188 asprintf(&pidstr, "%d", kipp->ki_pid); in procstat() 192 cmd->cmd(prstat, kipp); in procstat() 215 kinfo_proc_sort(struct kinfo_proc *kipp, int count) in kinfo_proc_sort() argument 218 qsort(kipp, count, sizeof(*kipp), kinfo_proc_compare); in kinfo_proc_sort() 222 kinfo_proc_thread_name(const struct kinfo_proc *kipp) in kinfo_proc_thread_name() argument 226 strlcpy(name, kipp->ki_tdname, sizeof(name)); in kinfo_proc_thread_name() 227 strlcat(name, kipp->ki_moretdname, sizeof(name)); in kinfo_proc_thread_name() 228 if (name[0] == '\0' || strcmp(kipp->ki_comm, name) == 0) { in kinfo_proc_thread_name()
|
H A D | procstat_vm.c | 45 procstat_vm(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_vm() argument 58 xo_emit("{ek:process_id/%d}", kipp->ki_pid); in procstat_vm() 60 freep = procstat_getvmmap(procstat, kipp, &cnt); in procstat_vm() 67 xo_emit("{dk:process_id/%5d} ", kipp->ki_pid); in procstat_vm()
|
H A D | procstat_files.c | 288 procstat_files(struct procstat *procstat, struct kinfo_proc *kipp) in procstat_files() argument 307 head = procstat_getfiles(procstat, kipp, 0); in procstat_files() 333 xo_emit("{ek:process_id/%5d/%d}", kipp->ki_pid); in procstat_files() 334 xo_emit("{e:command/%-16s/%s}", kipp->ki_comm); in procstat_files() 338 xo_emit("{dk:process_id/%5d/%d} ", kipp->ki_pid); in procstat_files() 339 xo_emit("{d:command/%-16s/%s} ", kipp->ki_comm); in procstat_files()
|
H A D | procstat_ptlwpinfo.c | 36 procstat_ptlwpinfo(struct procstat *prstat, struct kinfo_proc *kipp __unused) in procstat_ptlwpinfo()
|
H A D | procstat_advlock.c | 44 procstat_advlocks(struct procstat *prstat, struct kinfo_proc *kipp __unused) in procstat_advlocks()
|
/freebsd/lib/libutil/ |
H A D | kinfo_getallproc.c | 57 kinfo_proc_sort(struct kinfo_proc *kipp, int count) in kinfo_proc_sort() argument 60 qsort(kipp, count, sizeof(*kipp), kinfo_proc_compare); in kinfo_proc_sort() 66 struct kinfo_proc *kipp; in kinfo_getallproc() local 78 kipp = malloc(len); in kinfo_getallproc() 79 if (kipp == NULL) in kinfo_getallproc() 82 if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) in kinfo_getallproc() 84 if (len % sizeof(*kipp) != 0) in kinfo_getallproc() 86 if (kipp->ki_structsize != sizeof(*kipp)) in kinfo_getallproc() 88 *cntp = len / sizeof(*kipp); in kinfo_getallproc() 89 kinfo_proc_sort(kipp, len / sizeof(*kipp)); in kinfo_getallproc() [all …]
|
H A D | kinfo_getproc.c | 40 struct kinfo_proc *kipp; in kinfo_getproc() local 44 len = sizeof(*kipp); in kinfo_getproc() 45 kipp = malloc(len); in kinfo_getproc() 46 if (kipp == NULL) in kinfo_getproc() 54 if (sysctl(mib, nitems(mib), kipp, &len, NULL, 0) < 0) in kinfo_getproc() 56 if (len != sizeof(*kipp)) in kinfo_getproc() 58 if (kipp->ki_structsize != sizeof(*kipp)) in kinfo_getproc() 60 if (kipp->ki_pid != pid) in kinfo_getproc() 62 return (kipp); in kinfo_getproc() 64 free(kipp); in kinfo_getproc()
|
/freebsd/tools/test/stress2/misc/ |
H A D | kinfo.sh | 107 struct kinfo_proc *kipp; 118 kipp = malloc(len); 119 if (kipp == NULL) 122 if (sysctl(name, 3, kipp, &len, NULL, 0) < 0) { 123 free(kipp); 128 for (i = 0; i < len / sizeof(*kipp); i++) { 131 freep = kinfo_getfile(kipp[i].ki_pid, &cnt); 134 freep_vm = kinfo_getvmmap(kipp[i].ki_pid, &cnt); 138 free(kipp);
|
H A D | kinfo3.sh | 132 struct kinfo_proc *kipp; 147 kipp = malloc(len); 148 if (kipp == NULL) 151 if (sysctl(name, 3, kipp, &len, NULL, 0) < 0) { 152 free(kipp); 157 for (i = 0; i < (long)(len / sizeof(*kipp)); i++) { 160 freep = kinfo_getfile(kipp[i].ki_pid, &cnt); 167 freep_vm = kinfo_getvmmap(kipp[i].ki_pid, &cnt); 171 free(kipp);
|
/freebsd/usr.bin/systat/ |
H A D | proc.c | 179 per_proc_swap_usage(struct kinfo_proc *kipp) in per_proc_swap_usage() argument 187 freep = procstat_getvmmap(prstat, kipp, &cnt); in per_proc_swap_usage() 199 if (vm != NULL && vm->pid != kipp->ki_pid) { in per_proc_swap_usage() 202 vm->pid = kipp->ki_pid; in per_proc_swap_usage() 236 struct kinfo_proc *kipp; in procgetinfo() local 242 kipp = procstat_getprocs(prstat, KERN_PROC_PROC, 0, &cnt); in procgetinfo() 243 if (kipp == NULL) { in procgetinfo() 257 pages = per_proc_swap_usage(&kipp[i]); in procgetinfo() 265 strlcpy(pu[nproc]->command, kipp[i].ki_comm, in procgetinfo() 267 pu[nproc]->pid = kipp[i].ki_pid; in procgetinfo() [all …]
|