Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ps - Adjust ps to account for kernel changes

* ccpu no longer exists.

* pctcpu is now accurate regardless of the lwp's state.
  • Loading branch information...
commit 0274e76b7a37c212f919bdd82c08a6c821e2ec7c 1 parent bc55d64
Matthew Dillon authored
Showing with 1 addition and 9 deletions.
  1. +0 −1  bin/ps/extern.h
  2. +0 −4 bin/ps/nlist.c
  3. +1 −4 bin/ps/print.c
View
1  bin/ps/extern.h
@@ -40,7 +40,6 @@ struct nlist;
struct var;
struct varent;
-extern fixpt_t ccpu;
extern int eval, fscale, mempages, nlistread, rawcpu, cflag;
extern int sumrusage, termwidth, totwidth;
extern int numcpus;
View
4 bin/ps/nlist.c
@@ -44,7 +44,6 @@
#include "ps.h"
-fixpt_t ccpu; /* kernel _ccpu variable */
int nlistread; /* if nlist already read. */
int mempages; /* number of pages of phys. memory */
int fscale; /* kernel _fscale variable */
@@ -54,9 +53,6 @@ donlist(void)
{
size_t oldlen;
- oldlen = sizeof(ccpu);
- if (sysctlbyname("kern.ccpu", &ccpu, &oldlen, NULL, 0) < 0)
- return (1);
oldlen = sizeof(fscale);
if (sysctlbyname("kern.fscale", &fscale, &oldlen, NULL, 0) < 0)
return (1);
View
5 bin/ps/print.c
@@ -516,10 +516,7 @@ getpcpu(const KINFO *k)
/* XXX - I don't like this */
if (KI_PROC(k, swtime) == 0 || (KI_PROC(k, flags) & P_SWAPPEDOUT))
return (0.0);
- if (rawcpu)
- return (100.0 * fxtofl(KI_LWP(k, pctcpu)));
- return (100.0 * fxtofl(KI_LWP(k, pctcpu)) /
- (1.0 - exp(KI_PROC(k, swtime) * log(fxtofl(ccpu)))));
+ return (100.0 * fxtofl(KI_LWP(k, pctcpu)));
}
void
Please sign in to comment.
Something went wrong with that request. Please try again.