[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.82 and 1.83

version 1.82, 2015/01/19 01:53:18 version 1.83, 2015/01/19 18:01:13
Line 53 
Line 53 
 #include "display.h"  #include "display.h"
 #include "machine.h"  #include "machine.h"
 #include "utils.h"  #include "utils.h"
 #include "loadavg.h"  
   
 static int      swapmode(int *, int *);  static int      swapmode(int *, int *);
 static char     *state_abbr(struct kinfo_proc *);  static char     *state_abbr(struct kinfo_proc *);
Line 506 
Line 505 
         cputime = pp->p_rtime_sec + ((pp->p_rtime_usec + 500000) / 1000000);          cputime = pp->p_rtime_sec + ((pp->p_rtime_usec + 500000) / 1000000);
   
         /* calculate the base for cpu percentages */          /* calculate the base for cpu percentages */
         pct = pctdouble(pp->p_pctcpu);          pct = (double)pp->p_pctcpu / fscale;
   
         if (pp->p_wmesg[0])          if (pp->p_wmesg[0])
                 p_wait = pp->p_wmesg;                  p_wait = pp->p_wmesg;
Line 551 
Line 550 
  */   */
   
 #define ORDERKEY_PCTCPU \  #define ORDERKEY_PCTCPU \
         if (lresult = (pctcpu)p2->p_pctcpu - (pctcpu)p1->p_pctcpu, \          if ((result = (int)(p2->p_pctcpu - p1->p_pctcpu)) == 0)
             (result = lresult > 0 ? 1 : lresult < 0 ? -1 : 0) == 0)  
 #define ORDERKEY_CPUTIME \  #define ORDERKEY_CPUTIME \
         if ((result = p2->p_rtime_sec - p1->p_rtime_sec) == 0) \          if ((result = p2->p_rtime_sec - p1->p_rtime_sec) == 0) \
                 if ((result = p2->p_rtime_usec - p1->p_rtime_usec) == 0)                  if ((result = p2->p_rtime_usec - p1->p_rtime_usec) == 0)
Line 577 
Line 575 
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
         struct kinfo_proc *p1, *p2;          struct kinfo_proc *p1, *p2;
         pctcpu lresult;  
         int result;          int result;
   
         /* remove one level of indirection */          /* remove one level of indirection */
Line 601 
Line 598 
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
         struct kinfo_proc *p1, *p2;          struct kinfo_proc *p1, *p2;
         pctcpu lresult;  
         int result;          int result;
   
         /* remove one level of indirection */          /* remove one level of indirection */
Line 625 
Line 621 
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
         struct kinfo_proc *p1, *p2;          struct kinfo_proc *p1, *p2;
         pctcpu lresult;  
         int result;          int result;
   
         /* remove one level of indirection */          /* remove one level of indirection */
Line 649 
Line 644 
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
         struct kinfo_proc *p1, *p2;          struct kinfo_proc *p1, *p2;
         pctcpu lresult;  
         int result;          int result;
   
         /* remove one level of indirection */          /* remove one level of indirection */
Line 673 
Line 667 
         struct proc   **pp1 = (struct proc **) v1;          struct proc   **pp1 = (struct proc **) v1;
         struct proc   **pp2 = (struct proc **) v2;          struct proc   **pp2 = (struct proc **) v2;
         struct kinfo_proc *p1, *p2;          struct kinfo_proc *p1, *p2;
         pctcpu lresult;  
         int result;          int result;
   
         /* remove one level of indirection */          /* remove one level of indirection */
Line 696 
Line 689 
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
         struct kinfo_proc *p1, *p2;          struct kinfo_proc *p1, *p2;
         pctcpu lresult;  
         int result;          int result;
   
         /* remove one level of indirection */          /* remove one level of indirection */
Line 720 
Line 712 
         struct proc **pp1 = (struct proc **) v1;          struct proc **pp1 = (struct proc **) v1;
         struct proc **pp2 = (struct proc **) v2;          struct proc **pp2 = (struct proc **) v2;
         struct kinfo_proc *p1, *p2;          struct kinfo_proc *p1, *p2;
         pctcpu lresult;  
         int result;          int result;
   
         /* remove one level of indirection */          /* remove one level of indirection */

Legend:
Removed from v.1.82  
changed lines
  Added in v.1.83