Lines Matching refs:up

162 	struct uproc	*up, *parent, *pgrp;  in main()  local
357 up = findhash(info.pr_pid); in main()
358 up->p_ttyd = info.pr_ttydev; in main()
359 up->p_state = (info.pr_nlwp == 0? ZOMBIE : RUNNING); in main()
360 up->p_time = 0; in main()
361 up->p_ctime = 0; in main()
362 up->p_igintr = 0; in main()
363 (void) strncpy(up->p_comm, info.pr_fname, in main()
365 up->p_args[0] = 0; in main()
367 if (up->p_state != NONE && up->p_state != ZOMBIE) { in main()
395 up->p_time = statinfo.pr_utime.tv_sec + in main()
397 up->p_ctime = statinfo.pr_cutime.tv_sec + in main()
427 up->p_igintr = in main()
434 up->p_args[0] = 0; in main()
436 (void) strcat(up->p_args, info.pr_psargs); in main()
437 if (up->p_args[0] == 0 || in main()
438 up->p_args[0] == '-' && up->p_args[1] <= ' ' || in main()
439 up->p_args[0] == '?') { in main()
440 (void) strcat(up->p_args, " ("); in main()
441 (void) strcat(up->p_args, up->p_comm); in main()
442 (void) strcat(up->p_args, ")"); in main()
453 up->p_pgrpl = pgrp->p_pgrpl; in main()
454 pgrp->p_pgrpl = up; in main()
461 up->p_sibling = parent->p_child; in main()
462 up->p_child = 0; in main()
464 parent->p_child = up; in main()
525 showtotals(struct uproc *up) in showtotals() argument
533 calctotals(up); in showtotals()
558 calctotals(struct uproc *up) in calctotals() argument
568 if (up->p_state == VISITED) in calctotals()
570 up->p_state = VISITED; in calctotals()
571 if (up->p_state == NONE || up->p_state == ZOMBIE) in calctotals()
574 if (empty && !up->p_igintr) { in calctotals()
579 if (up->p_upid > curpid && (!up->p_igintr || empty)) { in calctotals()
580 curpid = up->p_upid; in calctotals()
582 (void) strcpy(doing, up->p_args); in calctotals()
584 (void) strcpy(doing, up->p_comm); in calctotals()
588 jobtime += up->p_time + up->p_ctime; in calctotals()
589 proctime += up->p_time; in calctotals()
593 if (up->p_child) { in calctotals()
594 calctotals(up->p_child); in calctotals()
595 for (zp = up->p_child->p_sibling; zp; zp = zp->p_sibling) in calctotals()
611 struct uproc *up, *tp; in findhash() local
613 tp = up = &pr_htbl[pid % HSIZE]; in findhash()
614 if (up->p_upid == 0) { /* empty slot */ in findhash()
615 up->p_upid = pid; in findhash()
616 up->p_state = NONE; in findhash()
617 up->p_child = up->p_sibling = up->p_pgrpl = up->p_link = 0; in findhash()
618 return (up); in findhash()
620 if (up->p_upid == pid) { /* found in hash table */ in findhash()
621 return (up); in findhash()
623 for (tp = up->p_link; tp; tp = tp->p_link) { /* follow chain */ in findhash()
637 tp->p_link = up->p_link; /* insert after head */ in findhash()
638 up->p_link = tp; in findhash()