home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / sun / volume2 / tahoe-systat / patch01 / pigs.c.diff < prev    next >
Encoding:
Text File  |  1990-10-23  |  1.7 KB  |  64 lines

  1. *** pigs.c.orig    Mon Jun 11 15:32:57 1990
  2. --- pigs.c    Thu Jun 14 11:35:50 1990
  3. ***************
  4. *** 149,160 ****
  5.           { "_proc" },
  6.   #define X_NPROC         1
  7.           { "_nproc" },
  8. ! #define X_USRPTMAP      2
  9.           { "_Usrptmap" },
  10. ! #define X_USRPT         3
  11.           { "_usrpt" },
  12. ! #define X_CPTIME    4
  13. !     { "_cp_time" },
  14.           { "" }
  15.   };
  16.   
  17. --- 149,162 ----
  18.           { "_proc" },
  19.   #define X_NPROC         1
  20.           { "_nproc" },
  21. ! #define X_CPTIME    2
  22. !     { "_cp_time" },
  23. ! #ifndef sun
  24. ! #define X_USRPTMAP      3
  25.           { "_Usrptmap" },
  26. ! #define X_USRPT         4
  27.           { "_usrpt" },
  28. ! # endif
  29.           { "" }
  30.   };
  31.   
  32. ***************
  33. *** 174,183 ****
  34. --- 176,187 ----
  35.           }
  36.       if (kprocp == NULL)
  37.                   kprocp = (struct proc *)calloc(nproc, sizeof (struct proc));
  38. + # ifndef sun
  39.           if (usrpt != NULL)
  40.           return(1);
  41.       usrpt = (struct pte *)nlst[X_USRPT].n_value;
  42.       Usrptma = (struct pte *)nlst[X_USRPTMAP].n_value;
  43. + # endif
  44.       if (pt == NULL)
  45.           pt = (struct p_times *)calloc(nproc, sizeof (struct p_times));
  46.       lseek(kmem, (long)nlst[X_CPTIME].n_value, L_SET);
  47. ***************
  48. *** 215,221 ****
  49.                           continue;
  50.                   prt->pt_pid = pp->p_pid;
  51.                   prt->pt_pp = pp;
  52. !                 prt->pt_pctcpu = pp->p_pctcpu / (1.0 - exp(time * lccpu));
  53.                   prt->pt_uid = pp->p_uid;
  54.                   prt++;
  55.           }
  56. --- 219,225 ----
  57.                           continue;
  58.                   prt->pt_pid = pp->p_pid;
  59.                   prt->pt_pp = pp;
  60. !                 prt->pt_pctcpu = FSC(pp->p_pctcpu) / (1.0 - exp(time * lccpu));
  61.                   prt->pt_uid = pp->p_uid;
  62.                   prt++;
  63.           }
  64.