Browse Source

Plan 9 from Bell Labs 2003-10-28

David du Colombier 20 years ago
parent
commit
83da1535e8
3 changed files with 26 additions and 24 deletions
  1. 2 2
      dist/replica/plan9.db
  2. 2 0
      dist/replica/plan9.log
  3. 22 22
      sys/src/cmd/stats.c

+ 2 - 2
dist/replica/plan9.db

@@ -389,7 +389,7 @@
 386/bin/srvold9p - 775 sys sys 1064598316 130962
 386/bin/ssh - 775 sys sys 1066515694 210438
 386/bin/sshnet - 775 sys sys 1064598319 283974
-386/bin/stats - 775 sys sys 1066515228 188651
+386/bin/stats - 775 sys sys 1067278459 188751
 386/bin/strings - 775 sys sys 1064598320 60633
 386/bin/strip - 775 sys sys 1064598321 60583
 386/bin/sum - 775 sys sys 1064598321 40087
@@ -10133,7 +10133,7 @@ sys/src/cmd/ssh/ssh.h - 664 sys sys 1048179595 6054
 sys/src/cmd/ssh/sshnet.c - 664 sys sys 1062091019 17661
 sys/src/cmd/ssh/sshserve.c - 664 sys sys 1062091020 5786
 sys/src/cmd/ssh/util.c - 664 sys sys 1063858753 4478
-sys/src/cmd/stats.c - 664 sys sys 1066515220 27952
+sys/src/cmd/stats.c - 664 sys sys 1067278458 28129
 sys/src/cmd/strings.c - 664 sys sys 944961364 1216
 sys/src/cmd/strip.c - 664 sys sys 1014926661 3306
 sys/src/cmd/sum.c - 664 sys sys 1014926615 5548

+ 2 - 0
dist/replica/plan9.log

@@ -13931,3 +13931,5 @@
 1067005874 0 c sys/games/lib/fortunes - 664 sys sys 1067005891 246404
 1067106682 0 c sys/src/9/port/lib.h - 664 sys sys 1067105741 5736
 1067120173 0 c sys/src/9/bitsy/mkfile - 664 sys sys 1067120164 2454
+1067279475 0 c 386/bin/stats - 775 sys sys 1067278459 188751
+1067279475 1 c sys/src/cmd/stats.c - 664 sys sys 1067278458 28129

+ 22 - 22
sys/src/cmd/stats.c

@@ -192,6 +192,7 @@ double	scale = 1.0;
 int		logscale = 0;
 int		ylabels = 0;
 int		oldsystem = 0;
+int 	sleeptime = 1000;
 
 char		*procnames[NPROC] = {"main", "mouse"};
 
@@ -773,54 +774,54 @@ void
 contextval(Machine *m, ulong *v, ulong *vmax, int init)
 {
 	*v = m->devsysstat[Context]-m->prevsysstat[Context];
-	*vmax = 1000*m->nproc;
+	*vmax = sleeptime*m->nproc;
 	if(init)
-		*vmax = 1000;
+		*vmax = sleeptime;
 }
 
 void
 intrval(Machine *m, ulong *v, ulong *vmax, int init)
 {
 	*v = m->devsysstat[Interrupt]-m->prevsysstat[Interrupt];
-	*vmax = 1000*m->nproc;
+	*vmax = sleeptime*m->nproc;
 	if(init)
-		*vmax = 1000;
+		*vmax = sleeptime;
 }
 
 void
 syscallval(Machine *m, ulong *v, ulong *vmax, int init)
 {
 	*v = m->devsysstat[Syscall]-m->prevsysstat[Syscall];
-	*vmax = 1000*m->nproc;
+	*vmax = sleeptime*m->nproc;
 	if(init)
-		*vmax = 1000;
+		*vmax = sleeptime;
 }
 
 void
 faultval(Machine *m, ulong *v, ulong *vmax, int init)
 {
 	*v = m->devsysstat[Fault]-m->prevsysstat[Fault];
-	*vmax = 1000*m->nproc;
+	*vmax = sleeptime*m->nproc;
 	if(init)
-		*vmax = 1000;
+		*vmax = sleeptime;
 }
 
 void
 tlbmissval(Machine *m, ulong *v, ulong *vmax, int init)
 {
 	*v = m->devsysstat[TLBfault]-m->prevsysstat[TLBfault];
-	*vmax = 10*m->nproc;
+	*vmax = (sleeptime/1000)*10*m->nproc;
 	if(init)
-		*vmax = 10;
+		*vmax = (sleeptime/1000)*10;
 }
 
 void
 tlbpurgeval(Machine *m, ulong *v, ulong *vmax, int init)
 {
 	*v = m->devsysstat[TLBpurge]-m->prevsysstat[TLBpurge];
-	*vmax = 10*m->nproc;
+	*vmax = (sleeptime/1000)*10*m->nproc;
 	if(init)
-		*vmax = 10;
+		*vmax = (sleeptime/1000)*10;
 }
 
 void
@@ -850,27 +851,27 @@ void
 etherval(Machine *m, ulong *v, ulong *vmax, int init)
 {
 	*v = m->netetherstats[In]-m->prevetherstats[In] + m->netetherstats[Out]-m->prevetherstats[Out];
-	*vmax = 1000*m->nproc;
+	*vmax = sleeptime*m->nproc;
 	if(init)
-		*vmax = 1000;
+		*vmax = sleeptime;
 }
 
 void
 etherinval(Machine *m, ulong *v, ulong *vmax, int init)
 {
 	*v = m->netetherstats[In]-m->prevetherstats[In];
-	*vmax = 1000*m->nproc;
+	*vmax = sleeptime*m->nproc;
 	if(init)
-		*vmax = 1000;
+		*vmax = sleeptime;
 }
 
 void
 etheroutval(Machine *m, ulong *v, ulong *vmax, int init)
 {
 	*v = m->netetherstats[Out]-m->prevetherstats[Out];
-	*vmax = 1000*m->nproc;
+	*vmax = sleeptime*m->nproc;
 	if(init)
-		*vmax = 1000;
+		*vmax = sleeptime;
 }
 
 void
@@ -881,9 +882,9 @@ ethererrval(Machine *m, ulong *v, ulong *vmax, int init)
 	*v = 0;
 	for(i=Err0; i<nelem(m->netetherstats); i++)
 		*v += m->netetherstats[i];
-	*vmax = 10*m->nproc;
+	*vmax = (sleeptime/1000)*10*m->nproc;
 	if(init)
-		*vmax = 10;
+		*vmax = (sleeptime/1000)*10;
 }
 
 void
@@ -901,7 +902,7 @@ signalval(Machine *m, ulong *v, ulong *vmax, int)
 {
 	ulong l;
 
-	*vmax = 1000;
+	*vmax = sleeptime;
 	l = m->netetherifstats[0];
 	/*
 	 * Range is seen to be from about -45 (strong) to -95 (weak); rescale
@@ -1211,7 +1212,6 @@ main(int argc, char *argv[])
 	char *s;
 	ulong v, vmax, nargs;
 	char args[100];
-	int sleeptime = 1000;
 
 	nmach = 1;
 	mysysname = getenv("sysname");