diff -urN procps-2.0.7/Makefile procps/Makefile --- procps-2.0.7/Makefile Thu Jul 13 13:22:58 2000 +++ procps/Makefile Wed May 22 16:18:10 2002 @@ -38,7 +38,7 @@ export OPT = -O3 export CFLAGS = -D_GNU_SOURCE $(OPT) -I$(shell pwd) $(INCDIRS) -Wall -Wno-unused -export SHARED = 1# build/install both a static and ELF shared library +export SHARED = 0 # build/install both a static and ELF shared library export SHLIBDIR = $(DESTDIR)/lib# where to install the shared library export LDFLAGS = -Wl,-warn-common #-s recommended for ELF systems diff -urN procps-2.0.7/NEWS procps/NEWS --- procps-2.0.7/NEWS Thu Jul 13 13:53:03 2000 +++ procps/NEWS Wed May 22 16:18:10 2002 @@ -2,6 +2,16 @@ Please send bug reports to procps-bugs@redhat.com +NEWS for procps 2.0.7 patched by Robert Love on 22 May 2002 + +Why don't we have a ChangeLog? This is lame. + +- Added display of real-time priority. Option value is "rtprio". +- Added display of scheduling policy. Option value is "class" or "policy". + +Both of these require kernel modifications. + + NEWS for version 2.0.7 of procps SMP support has been added to top. This adds one line to the screen diff -urN procps-2.0.7/proc/readproc.c procps/proc/readproc.c --- procps-2.0.7/proc/readproc.c Mon Jul 10 12:55:39 2000 +++ procps/proc/readproc.c Wed May 22 16:18:10 2002 @@ -164,7 +164,7 @@ "%ld " "%lu %lu %lu %lu %lu %lu " "%*s %*s %*s %*s " /* discard, no RT signals & Linux 2.1 used hex */ - "%lu %lu %lu %*d %d", + "%lu %lu %lu %*d %d %lu %lu", &P->state, &P->ppid, &P->pgrp, &P->session, &P->tty, &P->tpgid, &P->flags, &P->min_flt, &P->cmin_flt, &P->maj_flt, &P->cmaj_flt, &P->utime, &P->stime, @@ -173,7 +173,8 @@ &P->rss, &P->rss_rlim, &P->start_code, &P->end_code, &P->start_stack, &P->kstk_esp, &P->kstk_eip, /* P->signal, P->blocked, P->sigignore, P->sigcatch, */ /* can't use */ - &P->wchan, &P->nswap, &P->cnswap /* , &P->exit_signal */, &P->lproc); + &P->wchan, &P->nswap, &P->cnswap /* , &P->exit_signal */, &P->lproc, + &P->rtprio, &P->policy); /* TODO: add &P->exit_signal support here, perhaps to identify Linux threads */ /* fprintf(stderr, "stat2proc converted %d fields.\n",num); */ diff -urN procps-2.0.7/proc/readproc.h procps/proc/readproc.h --- procps-2.0.7/proc/readproc.h Mon Jul 10 09:53:37 2000 +++ procps/proc/readproc.h Wed May 22 16:47:23 2002 @@ -69,6 +69,8 @@ vm_stack, /* stack size */ vm_exe, /* executable size */ vm_lib, /* library size (all pages, not just used ones) */ + rtprio, /* real-time priority */ + policy, /* scheduling policy */ vsize, /* number of pages of virtual memory ... */ rss_rlim, /* resident set size ... ? */ flags, /* kernel flags for the process */ @@ -87,7 +89,6 @@ kstk_eip, /* kernel stack pointer */ start_time, /* start time of process -- seconds since 1-1-70 */ wchan; /* address of kernel wait channel proc is sleeping in */ - int lproc; /* last processor */ struct proc_s *l, /* ptrs for building arbitrary linked structs */ *r; /* (i.e. singly/doubly-linked lists and trees */ char @@ -105,6 +106,7 @@ fgroup[16], /* filesystem group name */ cmd[16]; /* basename of executable file in call to exec(2) */ int + lproc, /* last processor */ ruid, rgid, /* real */ euid, egid, /* effective */ suid, sgid, /* saved */ diff -urN procps-2.0.7/ps/output.c procps/ps/output.c --- procps-2.0.7/ps/output.c Tue Jul 11 11:37:46 2000 +++ procps/ps/output.c Wed May 22 16:18:10 2002 @@ -474,6 +474,21 @@ return sprintf(outbuf, "%ld", 60 + pp->priority); } +static int pr_rtprio(void){ /* 0..MAX_RT_PRI */ + return sprintf(outbuf, "%ld", pp->rtprio); +} + +static int pr_policy(void){ + switch (pp->policy) { + case 1: /* SCHED_FIFO */ + return sprintf(outbuf, "FIFO"); + case 2: /* SCHED_RR */ + return sprintf(outbuf, "RR"); + default: /* SCHED_OTHER or error */ + return sprintf(outbuf, "-"); + } +} + static int pr_wchan(void){ /* * Unix98 says "blank if running" and also "no blanks"! :-( @@ -876,7 +891,7 @@ /* temporary hack -- mark new stuff grabbed from Debian ps */ #define LNx LNX -/* there are about 194 listed */ +/* there are about 206 listed */ /* Many of these are placeholders for unsupported options. */ static const format_struct format_array[] = { @@ -895,7 +910,7 @@ {"bsdtime", "TIME", pr_bsdtime, sr_nop, 6, 0, LNX, RIGHT}, {"c", "C", pr_c, sr_pcpu, 2, 0, SUN, RIGHT}, {"caught", "CAUGHT", pr_sigcatch, sr_nop, 9, 0, BSD, SIGNAL}, /*sigcatch*/ -{"class", "CLS", pr_nop, sr_nop, 5, 0, XXX, RIGHT}, +{"class", "CLS", pr_policy, sr_nop, 5, 0, XXX, RIGHT}, {"cls", "-", pr_nop, sr_nop, 1, 0, HPU, RIGHT}, {"cmaj_flt", "-", pr_nop, sr_cmaj_flt, 1, 0, LNX, RIGHT}, {"cmd", "CMD", pr_args, sr_cmd, 16, 0, DEC, UNLIMITED}, /*ucomm*/ @@ -986,7 +1001,7 @@ {"pid", "PID", pr_pid, sr_pid, 5, 0, U98, RIGHT}, {"pmem", "%MEM", pr_pmem, sr_nop, 4, 0, XXX, RIGHT}, /*%mem*/ {"poip", "-", pr_nop, sr_nop, 1, 0, BSD, RIGHT}, -{"policy", "POL", pr_nop, sr_nop, 3, 0, DEC, RIGHT}, +{"policy", "POL", pr_policy, sr_nop, 3, 0, LNX, RIGHT}, {"ppid", "PPID", pr_ppid, sr_ppid, 5, 0, U98, RIGHT}, {"pri", "PRI", pr_pri, sr_nop, 3, 0, XXX, RIGHT}, {"priority", "PRI", pr_priority, sr_priority, 3, 0, LNX, RIGHT}, /*ni,nice*/ /* from Linux sorting names */ @@ -1003,7 +1018,7 @@ {"rss", "RSS", pr_rss, sr_rss, 4, 0, XXX, RIGHT}, /* was 5 wide */ {"rssize", "RSS", pr_rss, sr_vm_rss, 4, 0, DEC, RIGHT}, /*rsz*/ {"rsz", "RSZ", pr_rss, sr_vm_rss, 4, 0, BSD, RIGHT}, /*rssize*/ -{"rtprio", "RTPRIO", pr_nop, sr_nop, 7, 0, BSD, RIGHT}, +{"rtprio", "RTPRIO", pr_rtprio, sr_nop, 7, 0, BSD, RIGHT}, {"ruid", "RUID", pr_ruid, sr_ruid, 5, 0, XXX, RIGHT}, {"ruser", "RUSER", pr_ruser, sr_ruser, 8, 0, U98, USER}, {"s", "S", pr_s, sr_state, 1, 0, SUN, LEFT}, /*stat,state*/ diff -urN procps-2.0.7/ps/ps.1 procps/ps/ps.1 --- procps-2.0.7/ps/ps.1 Tue Jul 11 10:22:44 2000 +++ procps/ps/ps.1 Wed May 22 16:46:22 2002 @@ -438,6 +438,7 @@ pgrp PGRP pid PID pmem %MEM +policy POL ppid PPID pri PRI rgid RGID @@ -445,6 +446,7 @@ rss RSS rssize RSS rsz RSZ +rtprio RTPRIO ruid RUID ruser RUSER s S