From af6ec76eeef213b82bc18ea886651134a9ae8ef0 Mon Sep 17 00:00:00 2001 From: marko Date: Wed, 2 May 2007 11:36:50 +0000 Subject: [PATCH] Wipe out mbuf / cluster usage monitoring routines. Accounting and imposing limits on mbuf usage is quite different on FreeBSD -CURRENT from what it was on 4.11, so don't mess with those details at the moment. Bug found by: Submitted by: Requested by: Reviewed by: Approved by: Obtained from: --- exec.tcl | 81 -------------------------------------------------------- 1 file changed, 81 deletions(-) diff --git a/exec.tcl b/exec.tcl index 560b7f7..59ad9a4 100755 --- a/exec.tcl +++ b/exec.tcl @@ -74,48 +74,6 @@ proc nexec { args } { } -#****f* exec.tcl/nexec_monitor -# NAME -# nexec_monitor -- execute monitor -# SYNOPSIS -# set result [nexec_monitor $args] -# FUNCTION -# Executes the sting given in args variable. The sting is not executed -# if IMUNES is running in editor only mode. Execution of a string can -# be local or remote. Opens a monitor socket if it is not yet opened. -# Sends the arguments to monitor socket if the remote execution is -# selected, otherwise executes arguments locally. -# INPUTS -# * args -- the string that should be executed locally or remotely. -# RESULT -# * result -- the standard output of the executed string. -#**** -proc nexec_monitor { args } { - global remote_exec editor_only - global monSock - - if { $remote_exec } { - if { ![info exists monSock] || $monSock == "" } { - remoteStart - } - } - - if { $editor_only } { - tk_messageBox -title "Editor only" \ - -message "Running in editor only mode. Cannot execute commands. Please report this problem." \ - -type ok - exit 5 - } - - if { $remote_exec } { - rexec $monSock $args - } else { - eval exec $args - } -} - - - #****f* exec.tcl/setOperMode # NAME # setOperMode -- set operating mode @@ -139,7 +97,6 @@ proc nexec_monitor { args } { #**** proc setOperMode { mode } { global oper_mode activetool node_list - global nmbufs nmbclusters global editor_only remote_exec execSock global undolevel redolevel @@ -190,9 +147,6 @@ proc setOperMode { mode } { .menubar.edit entryconfigure "Undo" -state disabled .menubar.edit entryconfigure "Redo" -state disabled set oper_mode exec - set nmbufs [lindex [split [nexec sysctl kern.ipc.nmbufs]] 1] - set nmbclusters [lindex [split [nexec sysctl kern.ipc.nmbclusters]] 1] - monitor_loop if { $remote_exec } { nexec create_conf_file config.imn dumpCfg file $execSock @@ -702,41 +656,6 @@ proc vimageCleanup {} { } -#****f* exec.tcl/monitor_loop -# NAME -# monitor_loop -- monitor loop -# SYNOPSIS -# monitor_loop -# FUNCTION -# Calculates the usage of cpu, mbuffers and mbuf clusters. -# The results are displayed in status line and updated -# every two seconds. -#**** -proc monitor_loop {} { - global oper_mode - global nmbufs nmbclusters - - if {$oper_mode != "exec"} { - .bottom.cpu_load config -text "" - .bottom.mbuf config -text "" - return - } - - set cpu_load [expr ([lindex [split [nexec_monitor sysctl kern.cp_time_avg]] end] + \ - 5000) / 10000] - .bottom.cpu_load config -text "CPU $cpu_load%" - - set nstout [split [nexec_monitor netstat -m] ] - set mbufs [lindex [split [lindex $nstout 0] /] 0] - set clusts [lindex [split [lsearch -inline $nstout "*/$nmbclusters"] /] 0] - set mbufp [expr $mbufs * 100 / $nmbufs] - set clustp [expr $clusts * 100 / $nmbclusters] - .bottom.mbuf config -text "mbuf/clus $mbufp%/$clustp%" - - after 2000 { monitor_loop } -} - - #****f* exec.tcl/execSetIfcQDisc # NAME # execSetIfcQDisc -- in exec mode set interface queuing discipline -- 2.39.5