Lines Matching refs:slot

217   int (*match_process)(long long *slot);
234 * struct procpid contains a slot[] array of 64 bit values, with the following
275 /* In addition to slot[], carevup contains 6 string fields to display
282 long long slot[SLOT_count]; // data (see enum above)
299 * slot: which slot[] out of procpid. Negative means it's a string field.
316 signed char width, slot;
318 // Numbers. (What's in slot[] is what's displayed, sorted numerically.)
340 // String fields (-1 is procpid->str, rest are str+offset[1-slot])
460 static int shared_match_process(long long *slot)
476 for (j = 0; j<mm->len; j++) if (ll[j] == slot[match[i].len]) return 1;
484 static int ps_match_process(long long *slot)
486 int i = shared_match_process(slot);
493 if ((FLAG(a)||FLAG(d)) && slot[SLOT_sid]==*slot) return 0;
494 if (FLAG(a) && !slot[SLOT_ttynr]) return 0;
495 if (!(FLAG(a)||FLAG(d)||FLAG(A)||FLAG(e)) && TT.tty!=slot[SLOT_ttynr])
505 int which = field->which, sl = typos[which].slot;
506 long long *slot = tb->slot, ll = (sl >= 0) ? slot[sl&(XX-1)] : 0;
525 // First string slot has offset 0, others are offset[-slot-2]
531 for (i = 0; (which==PS_ARGS) ? i < slot[SLOT_argv0len] : out[i]; i++)
559 // top adjusts slot[SLOT_upticks], we want original meaning.
560 if (which==PS_ELAPSED) ll = (slot[SLOT_uptime]*j)-slot[SLOT_starttime];
580 ll = slot[sl&(XX-1)]*1000;
582 ll /= slot[SLOT_totalram]/((which==PS__VSZ) ? 1024 : 4096);
583 else if (slot[SLOT_upticks]) ll /= slot[SLOT_upticks];
595 if ((ll = slot[typos[which].slot])<0) {
606 } else if (which==PS_F) sprintf(out, "%llo", (slot[SLOT_flags]>>6)&5);
612 if (slot[SLOT_nice]<0) *s++ = '<';
613 else if (slot[SLOT_nice]>0) *s++ = 'N';
614 if (slot[SLOT_sid]==*slot) *s++ = 's';
615 if (slot[SLOT_vmlck]) *s++ = 'L';
616 if (slot[SLOT_ttypgrp]==*slot) *s++ = '+';
620 time_t t = time(0)-slot[SLOT_uptime]+slot[SLOT_starttime]/TT.ticks;
714 long long *slot = tb->slot;
726 memset(slot, 0, sizeof(tb->slot));
727 slot[SLOT_tid] = *slot = atol(new->name);
731 *slot = *tb2->slot;
734 if (*slot == slot[SLOT_tid]) slot = tb2->slot;
740 sprintf(buf, "%lld/stat", slot[SLOT_tid]);
753 // All remaining fields should be numeric, parse them into slot[] array
754 // (skipping first 3 stat fields and first slot[], both were handled above)
755 // yes this means the alignment's off: stat[4] becomes slot[1]
757 if (1>sscanf(s += i, " %lld%n", slot+j, &i)) break;
759 // Now we've read the data, move status and name right after slot[] array,
773 slot[SLOT_uid] = new->st.st_uid;
774 slot[SLOT_gid] = new->st.st_gid;
777 slot[SLOT_utime] += slot[SLOT_stime];
778 slot[SLOT_utime2] = slot[SLOT_utime];
786 sprintf(buf, "%lld/status", slot[SLOT_tid]);
789 slot[SLOT_ruid] = s ? atol(s) : new->st.st_uid;
791 slot[SLOT_rgid] = s ? atol(s) : new->st.st_gid;
792 if ((s = strafter(buf, "\nVmLck:"))) slot[SLOT_vmlck] = atoll(s)*1024;
793 if ((s = strafter(buf, "\nVmSwap:"))) slot[SLOT_swap] = atoll(s)*1024;
800 sprintf(buf, "%lld/io", slot[SLOT_tid]);
802 if ((s = strafter(buf, "rchar:"))) slot[SLOT_rchar] = atoll(s);
803 if ((s = strafter(buf, "wchar:"))) slot[SLOT_wchar] = atoll(s);
804 if ((s = strafter(buf, "read_bytes:"))) slot[SLOT_rbytes] = atoll(s);
805 if ((s = strafter(buf, "write_bytes:"))) slot[SLOT_wbytes] = atoll(s);
806 slot[SLOT_iobytes] = slot[SLOT_rchar]+slot[SLOT_wchar]+slot[SLOT_swap];
807 slot[SLOT_diobytes] = slot[SLOT_rbytes]+slot[SLOT_wbytes]+slot[SLOT_swap];
811 if (slot != tb->slot) return 0;
814 if (TT.match_process && !TT.match_process(slot)) return 0;
819 slot[SLOT_uptime] = si.uptime;
820 slot[SLOT_totalram] = si.totalram;
821 slot[SLOT_upticks] = slot[SLOT_uptime]*TT.ticks - slot[SLOT_starttime];
827 sprintf(buf, "%lld/statm", slot[SLOT_tid]);
831 slot[SLOT_vsz] = slot[SLOT_shr] = 0;
832 sscanf(buf, "%lld %*d %lld", &slot[SLOT_vsz], &slot[SLOT_shr]);
839 sprintf(buf, "%lld/exe", slot[SLOT_tid]);
841 if (buf[4] == 1) slot[SLOT_bits] = 32;
842 else if (buf[4] == 2) slot[SLOT_bits] = 64;
848 get_sched_policy(slot[SLOT_tid], (void *)&slot[SLOT_pcy]);
862 slot[SLOT_argv0len] = 0;
877 sprintf(buf, "%lld/%s", slot[SLOT_tid], fetch[j].name);
893 if (!ptb || slot[SLOT_argv0len]) ptb = tb;
894 i = ptb->slot[SLOT_argv0len];
908 int rdev = slot[SLOT_ttynr];
916 sprintf(buf, "%lld/fd/%i", slot[SLOT_tid], i);
975 // We do it for each file string slot but last is cmdline, which sticks.
976 slot[SLOT_argv0len] = temp ? temp : len; // Position of _first_ NUL
1026 tb->slot[SLOT_tcount] = kcount;
1032 tb->slot[SLOT_pid] = pid;
1033 tb->slot[SLOT_tcount] = kcount;
1220 int ret = 0, slot;
1223 slot = typos[field->which].slot;
1226 if (!(slot&XX)) {
1227 if (ta->slot[slot]<tb->slot[slot]) ret = -1;
1228 if (ta->slot[slot]>tb->slot[slot]) ret = 1;
1348 && field->which<=PS_RGROUP && (typos[field->which].slot&XX))
1424 // If we have both, adjust slot[deltas[]] to be relative to previous
1526 if (old.count && (!new.count || otb->slot[merge_idx] < ntb->slot[merge_idx])) {
1534 if (!old.count || otb->slot[merge_idx] > ntb->slot[merge_idx]) mix.tb[mix.count] = ntb;
1537 if (filter(otb->slot, ntb->slot, new.whence-old.whence)) {
1613 if (mix.count) up = mix.tb[0]->slot[SLOT_upticks];
1636 int slot = typos[field->which].slot&(XX-1);
1643 tb.slot[slot] += mix.tb[i]->slot[slot];
1825 if (kill(*tb->slot, TT.pgrep.signal)) {
1829 perror_msg("%s->%lld", s, *tb->slot);
1833 printf("%lld", *tb->slot);
1849 if (TT.pgrep.self == *tb->slot) return;
1867 long long ll = tb->slot[SLOT_starttime];
1877 static int pgrep_match_process(long long *slot)
1879 return !FLAG(v) == !!shared_match_process(slot);