Lines Matching defs:ps
25 * ps -- list process status
27 * fall back to /bin/ps if no support -- and you better match their args!
37 "[-1o?\n@(#)$Id: ps (AT&T Research) 2011-12-13 $\n]"
39 "[+NAME?ps - report process status]"
199 Pssent_t* ps; /* ps info */
229 Pss_t* pss; /* ps stream */
230 Pssdisc_t pssdisc; /* ps stream discipline */
560 key(void* handle, register Sffmt_t* fp, const char* arg, char** ps, Sflong_t* pn)
632 *ps = arg && (arg = (const char*)strdup(arg)) ? (char*)arg : kp->head;
644 if (pp->ps->state == PSS_ZOMBIE)
646 n = (long)pp->ps->addr;
649 if (pp->ps->state == PSS_ZOMBIE)
651 s = pp->ps->sched;
654 s = pp->ps->args;
657 s = pp->ps->command;
675 if (pp->ps->state == PSS_ZOMBIE)
677 n = pp->ps->cpu;
681 s = fmtelapsed(state.now - (unsigned long)pp->ps->start, 1);
683 n = pp->ps->start;
686 n = pp->ps->flags & PSS_FLAGS;
691 s = fmtgid(pp->ps->gid);
696 n = pp->ps->gid;
699 if (pp->ps->state == PSS_ZOMBIE)
701 n = pp->ps->nice;
704 n = pp->ps->npid;
707 n = pp->ps->pgrp;
710 n = pp->ps->pid;
713 n = pp->ps->ppid;
716 if (pp->ps->state == PSS_ZOMBIE)
718 n = pp->ps->pri;
721 n = pp->ps->refcount;
724 if (pp->ps->state == PSS_ZOMBIE)
726 n = pp->ps->rss;
729 n = pp->ps->sid;
732 if (pp->ps->state == PSS_ZOMBIE)
734 n = pp->ps->size;
737 if (pp->ps->state == PSS_ZOMBIE)
741 u = pp->ps->start;
745 n = pp->ps->start;
748 *(s = sbuf) = pp->ps->state;
752 n = pp->ps->tgrp;
756 s = fmtelapsed(pp->ps->time, 1);
758 n = pp->ps->time;
761 if (pp->ps->state == PSS_ZOMBIE)
763 s = pssttyname(state.pss, pp->ps);
787 n = pp->ps->uid;
790 if (pp->ps->state == PSS_ZOMBIE)
792 n = (long)pp->ps->wchan;
814 *ps = s;
822 * ps a single proc
826 ps(Ps_t* pp)
843 pr = pp->ps;
1011 * ps() a process and its children
1020 ps(pp);
1027 ps(pp);
1033 * ps() the selected procs
1052 if (pp->ps->pss & (PSS_EXPLICIT|PSS_MATCHED))
1057 xp->ps->pss |= PSS_PARENT;
1058 } while ((xp = (Ps_t*)dtmatch(state.bypid, &xp->ps->ppid)) && !xp->ps->pss);
1062 if (!(pp->ps->pss & (PSS_EXPLICIT|PSS_MATCHED|PSS_PARENT)) && !pp->seen)
1068 if (xp->ps->pss & (PSS_ANCESTOR|PSS_EXPLICIT|PSS_MATCHED))
1070 xp->ps->pss |= PSS_ANCESTOR;
1074 xp->ps->pss |= PSS_PARENT;
1075 } while ((xp = (Ps_t*)dtmatch(state.bypid, &xp->ps->ppid)) && !xp->ps->pss);
1078 } while (xp->ps->ppid != xp->ps->pid && (xp = (Ps_t*)dtmatch(state.bypid, &xp->ps->ppid)));
1082 if (pp->ps->pss)
1084 if (pp->ps->ppid != pp->ps->pid && (xp = (Ps_t*)dtmatch(state.bypid, &pp->ps->ppid)) && (xp->ps->pss & (PSS_EXPLICIT|PSS_MATCHED|PSS_PARENT)))
1086 xp->ps->pss |= PSS_CHILD;
1111 ps(pp);
1183 if (pa->ps->pgrp < pb->ps->pgrp)
1185 if (pa->ps->pgrp > pb->ps->pgrp)
1187 if (i = (pa->ps->pgrp == pa->ps->pid) - (pb->ps->pgrp == pb->ps->pid))
1189 if (pa->ps->start < pb->ps->start)
1191 if (pa->ps->start > pb->ps->start)
1193 if (pa->ps->pid < pb->ps->pid)
1195 if (pa->ps->pid > pb->ps->pid)
1240 pp->ps = pe;
1243 if (!(pp->ps = psssave(state.pss, pe)))
1475 error_info.id = "ps";
1502 * open the ps stream
1507 s = "/bin/ps";