Re: Problem with CPU - Activity

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Thu, 31 Oct 1996 17:54:47 +0100

Holger Brozio <holger@hercule.fulda.net> said:

Holger> I have got the following problem, while executing Tkined1.4.5
Holger> I am using ip-monitor|CPU-Activity with rpc.rstatd-3.03, the
Holger> barchart appears and it works fine for a while, but then
Holger> Tkined puts out the message:

>can't read "r(cp_user)": no such variable

Holger> Maybe it is a problem with the rpc.rstatd-3.03 ?!

I am not 100 % sure what is going wrong. Anyway, below is a patch
which might fix this problem. Let me know if it works.

Juergen

*** tkined/apps/ip_monitor.tcl.orig Wed Oct 23 12:16:32 1996
--- tkined/apps/ip_monitor.tcl Thu Oct 31 17:48:25 1996
***************
*** 442,447 ****
--- 442,449 ----

array set r [ComputeStatDelta $sysload_stat($id) $res]
set sysload_stat($id) $res
+ if {[array size r] == 0} continue
+
set load [format "%.2f" $r(avenrun_0)]

ined -noupdate values $id $load
***************
*** 515,520 ****
--- 517,524 ----

array set r [ComputeStatDelta $cpusplit_stat($id) $res]
set cpusplit_stat($id) $res
+ if {[array size r] == 0} continue
+
set load ""
foreach n $names {
lappend load $r($n)
***************
*** 593,598 ****
--- 597,604 ----

array set r [ComputeStatDelta $diskload_stat($id) $res]
set diskload_stat($id) $res
+ if {[array size r] == 0} continue
+
set load ""
foreach n $names {
lappend load [expr $r($n) * 2]
***************
*** 668,673 ****
--- 674,680 ----

array set r [ComputeStatDelta $ifload_stat($id) $res]
set ifload_stat($id) $res
+ if {[array size r] == 0} continue

set load ""
foreach n $names {