9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Steve Hemminger sch@postman.ncube.com
Subject: PC not updating counters
Date: Wed, 27 Sep 1995 19:20:20 -0400	[thread overview]
Message-ID: <19950927232020.skezXV39eHIAfX42EsjJDAUXyvfXQCWTVclEy_7ASsY@z> (raw)

The PC port is not updating the counters for syscalls and interrupts:
/sys/src/9/pc/trap.c
242a243
>       ++m->intr;
426a428
>       m->syscall++;
M cJ
Here is a short script to dump stats (a.l.a vmstat)
#!/bin/rc

switch ($#*) {
case 0
        count=1
        interval=1
case 1
        count=-1
        interval=$1
case 2
        count=$2
        interval=$1
case *
        echo "Usage: $0 [ interval [count]]"
        exit usage
}

echo 'procs    memory       swap'
echo 'r b w  used/avail  used/avail  csw int sys pg tlb pur ld'

n=0
l=(0 0 0 0 0 0 0 0)
while (test $n -ne $count) {
        ps | awk '
$6 == "Syscall"  { ++r }
$6 == "Ready"    { ++r }
$6 == "Scheding" { ++r }
$6 == "Running" { ++r } 
$6 == "Queueing" { ++b }
$6 == "Fault"   { ++w }
$6 == "Pageout" { ++w }
END             { printf "%d %d %d", r, b, w}'

        awk '{printf " %10s %10s", $1, $3}' </dev/swap
        v=`{cat </dev/sysstat}
        for (i in 2 3 4 5 6 7) {
                echo $v($i) $l($i) $interval | awk '{ printf " %3d", ($1-$2)/$3 }' 
        }
        echo $v(8) | awk '{printf " %.2f\n", $1/1000 }'

        l=$v
        n=`{echo $n | awk '{print $1+1}' }

        if (test $n -ne $count)
                sleep $interval
} 






                 reply	other threads:[~1995-09-27 23:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19950927232020.skezXV39eHIAfX42EsjJDAUXyvfXQCWTVclEy_7ASsY@z \
    --to=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).