[BACK]Return to machine.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / top

Diff for /src/usr.bin/top/machine.c between version 1.28 and 1.29

version 1.28, 2002/07/02 03:05:47 version 1.29, 2003/06/12 22:30:23
Line 170 
Line 170 
 int maxslp;  int maxslp;
   
 int  int
 getstathz()  getstathz(void)
 {  {
         struct clockinfo cinf;          struct clockinfo cinf;
         size_t  size = sizeof(cinf);          size_t  size = sizeof(cinf);
Line 184 
Line 184 
 }  }
   
 int  int
 machine_init(statics)  machine_init(struct statics *statics)
         struct statics *statics;  
 {  {
         int pagesize;          int pagesize;
   
Line 221 
Line 220 
 }  }
   
 char *  char *
 format_header(uname_field)  format_header(char *uname_field)
         char   *uname_field;  
 {  {
         char *ptr;          char *ptr;
   
Line 293 
Line 291 
 static struct handle handle;  static struct handle handle;
   
 struct kinfo_proc *  struct kinfo_proc *
 getprocs(op, arg, cnt)  getprocs(int op, int arg, int *cnt)
         int op, arg;  
         int *cnt;  
 {  {
         size_t size = sizeof(int);          size_t size = sizeof(int);
         int mib[4] = {CTL_KERN, KERN_PROC, op, arg};          int mib[4] = {CTL_KERN, KERN_PROC, op, arg};
Line 336 
Line 332 
 }  }
   
 caddr_t  caddr_t
 get_process_info(si, sel, compare)  get_process_info(struct system_info *si, struct process_select *sel,
         struct system_info *si;      int (*compare)(const void *, const void *))
         struct process_select *sel;  
         int (*compare)(const void *, const void *);  
   
 {  {
         int show_idle, show_system, show_uid, show_command;          int show_idle, show_system, show_uid, show_command;
         int total_procs, active_procs, i;          int total_procs, active_procs, i;
Line 409 
Line 402 
 char    fmt[MAX_COLS];          /* static area where result is built */  char    fmt[MAX_COLS];          /* static area where result is built */
   
 char *  char *
 format_next_process(handle, get_userid)  format_next_process(caddr_t handle, char *(*get_userid)())
         caddr_t handle;  
         char *(*get_userid)();  
   
 {  {
         char waddr[sizeof(void *) * 2 + 3];     /* Hexify void pointer */          char waddr[sizeof(void *) * 2 + 3];     /* Hexify void pointer */
         struct kinfo_proc *pp;          struct kinfo_proc *pp;
Line 520 
Line 510 
   
 /* compare_cpu - the comparison function for sorting by cpu percentage */  /* compare_cpu - the comparison function for sorting by cpu percentage */
 int  int
 compare_cpu(v1, v2)  compare_cpu(const void *v1, const void *v2)
         const void *v1, *v2;  
 {  {
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
Line 546 
Line 535 
   
 /* compare_size - the comparison function for sorting by total memory usage */  /* compare_size - the comparison function for sorting by total memory usage */
 int  int
 compare_size(v1, v2)  compare_size(const void *v1, const void *v2)
         const void *v1, *v2;  
 {  {
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
Line 572 
Line 560 
   
 /* compare_res - the comparison function for sorting by resident set size */  /* compare_res - the comparison function for sorting by resident set size */
 int  int
 compare_res(v1, v2)  compare_res(const void *v1, const void *v2)
         const void *v1, *v2;  
 {  {
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
Line 598 
Line 585 
   
 /* compare_time - the comparison function for sorting by CPU time */  /* compare_time - the comparison function for sorting by CPU time */
 int  int
 compare_time(v1, v2)  compare_time(const void *v1, const void *v2)
         const void *v1, *v2;  
 {  {
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
Line 624 
Line 610 
   
 /* compare_prio - the comparison function for sorting by CPU time */  /* compare_prio - the comparison function for sorting by CPU time */
 int  int
 compare_prio(v1, v2)  compare_prio(const void *v1, const void *v2)
         const void *v1, *v2;  
 {  {
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
Line 668 
Line 653 
  *      reflects this ordering.   *      reflects this ordering.
  */   */
 int  int
 proc_compare(v1, v2)  proc_compare(const void *v1, const void *v2)
         const void *v1, *v2;  
 {  {
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
Line 720 
Line 704 
  *              and "renice" commands.   *              and "renice" commands.
  */   */
 int  int
 proc_owner(pid)  proc_owner(pid_t pid)
         pid_t   pid;  
 {  {
         struct kinfo_proc **prefp, *pp;          struct kinfo_proc **prefp, *pp;
         int cnt;          int cnt;
Line 742 
Line 725 
  * to be based on the new swapctl(2) system call.   * to be based on the new swapctl(2) system call.
  */   */
 static int  static int
 swapmode(used, total)  swapmode(int *used, int *total)
         int    *used;  
         int    *total;  
 {  {
         int     nswap, rnswap, i;          int     nswap, rnswap, i;
         struct swapent *swdev;          struct swapent *swdev;

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29