• Home
  • Raw
  • Download

Lines Matching refs:slot

261   int (*match_process)(long long *slot);
308 long long slot[55]; // data from /proc member
318 signed char width, slot; member
358 static int shared_match_process(long long *slot) in shared_match_process() argument
373 for (j = 0; j<mm->len; j++) if (ll[j] == slot[match[i].len]) return 1; in shared_match_process()
382 static int ps_match_process(long long *slot) in ps_match_process() argument
384 int i = shared_match_process(slot); in ps_match_process()
391 if ((toys.optflags&(FLAG_a|FLAG_d)) && slot[SLOT_sid]==*slot) return 0; in ps_match_process()
392 if ((toys.optflags&FLAG_a) && !slot[SLOT_ttynr]) return 0; in ps_match_process()
394 && TT.tty!=slot[SLOT_ttynr]) return 0; in ps_match_process()
403 int which = field->which, sl = typos[which].slot; in string_field()
404 long long *slot = tb->slot, ll = (sl >= 0) ? slot[sl&63] : 0; in string_field() local
421 if (slot[SLOT_argv0len]) in string_field()
422 tb->str[tb->offset[4]+slot[SLOT_argv0len]] = (which==PS_NAME) ? 0 : ' '; in string_field()
453 if (which==PS_ELAPSED) ll = (slot[SLOT_uptime]*j)-slot[SLOT_starttime]; in string_field()
473 ll = slot[sl&63]*1000; in string_field()
476 else if (slot[SLOT_upticks]) ll /= slot[SLOT_upticks]; in string_field()
484 ll = slot[typos[which].slot]; in string_field()
491 } else if (which==PS_F) sprintf(out, "%llo", (slot[SLOT_flags]>>6)&5); in string_field()
497 if (slot[SLOT_nice]<0) *s++ = '<'; in string_field()
498 else if (slot[SLOT_nice]>0) *s++ = 'N'; in string_field()
499 if (slot[SLOT_sid]==*slot) *s++ = 's'; in string_field()
500 if (slot[SLOT_vmlck]) *s++ = 'L'; in string_field()
501 if (slot[SLOT_ttypgrp]==*slot) *s++ = '+'; in string_field()
505 time_t t = time(0)-slot[SLOT_uptime]+slot[SLOT_starttime]/TT.ticks; in string_field()
560 long long *slot = tb->slot; in get_ps() local
569 memset(slot, 0, sizeof(tb->slot)); in get_ps()
570 if (!(*slot = atol(new->name))) return 0; in get_ps()
574 sprintf(buf, "%lld/stat", *slot); in get_ps()
586 for (j = 1; j<50; j++) if (1>sscanf(s += i, " %lld%n", slot+j, &i)) break; in get_ps()
600 slot[SLOT_uid] = new->st.st_uid; in get_ps()
601 slot[SLOT_gid] = new->st.st_gid; in get_ps()
604 slot[SLOT_utime] += slot[SLOT_stime]; in get_ps()
605 slot[SLOT_utime2] = slot[SLOT_utime]; in get_ps()
614 sprintf(buf, "%lld/status", *slot); in get_ps()
617 slot[SLOT_ruid] = s ? atol(s) : new->st.st_uid; in get_ps()
619 slot[SLOT_rgid] = s ? atol(s) : new->st.st_gid; in get_ps()
620 if ((s = strafter(buf, "\nVmLck:"))) slot[SLOT_vmlck] = atoll(s); in get_ps()
621 if ((s = strafter(buf, "\nVmSwap:"))) slot[SLOT_swap] = atoll(s); in get_ps()
628 sprintf(buf, "%lld/io", *slot); in get_ps()
630 if ((s = strafter(buf, "rchar:"))) slot[SLOT_rchar] = atoll(s); in get_ps()
631 if ((s = strafter(buf, "wchar:"))) slot[SLOT_wchar] = atoll(s); in get_ps()
632 if ((s = strafter(buf, "read_bytes:"))) slot[SLOT_rbytes] = atoll(s); in get_ps()
633 if ((s = strafter(buf, "write_bytes:"))) slot[SLOT_wbytes] = atoll(s); in get_ps()
634 slot[SLOT_iobytes] = slot[SLOT_rchar]+slot[SLOT_wchar]+slot[SLOT_swap]; in get_ps()
635 slot[SLOT_diobytes] = slot[SLOT_rbytes]+slot[SLOT_wbytes]+slot[SLOT_swap]; in get_ps()
639 if (TT.match_process && !TT.match_process(slot)) return 0; in get_ps()
644 slot[SLOT_uptime] = TT.si.uptime; in get_ps()
645 slot[SLOT_upticks] = slot[SLOT_uptime]*TT.ticks - slot[SLOT_starttime]; in get_ps()
651 sprintf(buf, "%lld/statm", *slot); in get_ps()
655 if (!sscanf(s, " %lld%n", slot+SLOT_vsz+i, &j)) slot[SLOT_vsz+i] = 0; in get_ps()
663 slot[SLOT_argv0len] = 0; in get_ps()
674 sprintf(buf, "%lld/%s", *slot, fetch[j].name); in get_ps()
684 int rdev = slot[SLOT_ttynr]; in get_ps()
692 sprintf(buf, "%lld/fd/%i", *slot, i); in get_ps()
750 slot[SLOT_argv0len] = len; in get_ps()
929 int ret = 0, slot; in ksort() local
932 slot = typos[field->which].slot; in ksort()
935 if (!(slot&64)) { in ksort()
936 if (ta->slot[slot]<tb->slot[slot]) ret = -1; in ksort()
937 if (ta->slot[slot]>tb->slot[slot]) ret = 1; in ksort()
1051 && ever->which<=PS_RGROUP && (typos[ever->which].slot&64)) in ps_main()
1218 if (old.count && (!new.count || *otb->slot < *ntb->slot)) { in top_common()
1226 if (!old.count || *otb->slot > *ntb->slot) mix.tb[mix.count] = ntb; in top_common()
1229 if (filter(otb->slot, ntb->slot, new.whence-old.whence)) { in top_common()
1295 if (mix.count) up = mix.tb[0]->slot[SLOT_upticks]; in top_common()
1315 int slot = typos[fields->which].slot&63; in top_common() local
1322 tb.slot[slot] += mix.tb[i]->slot[slot]; in top_common()
1482 if (kill(*tb->slot, TT.pgrep.signal)) { in do_pgk()
1486 perror_msg("%s->%lld", s, *tb->slot); in do_pgk()
1490 printf("%lld", *tb->slot); in do_pgk()
1505 if (TT.pgrep.self == *tb->slot) return; in match_pgrep()
1520 long long ll = tb->slot[SLOT_starttime]; in match_pgrep()
1530 static int pgrep_match_process(long long *slot) in pgrep_match_process() argument
1532 int match = shared_match_process(slot); in pgrep_match_process()