--- scripts/latency-histogram.orig 2016-06-25 02:19:12 UTC +++ scripts/latency-histogram @@ -1,4 +1,4 @@ -#!/usr/bin/wish +#!/usr/bin/env wish8.6 # # Usage: @@ -51,7 +51,7 @@ package require Tclx proc set_defaults {} { set ::LH(start) [clock seconds] # don't include glxgears, error suffices - program_check {halrun halcmd lsmod pgrep pkill hostname} + program_check {halrun halcmd pgrep pkill hostname} if {[string first rtai [string tolower $::tcl_platform(osVersion)]] >=0} { set ::LH(rtai) rtai set ::LH(realtime) [exec linuxcnc_var REALTIME] @@ -234,25 +234,25 @@ $display \ } ;# other_info proc processor_info {} { - set cmdline [exec cat /proc/cmdline] - set idx [string first isolcpus $cmdline] - if {$idx < 0} { +# set cmdline [exec cat /proc/cmdline] +# set idx [string first isolcpus $cmdline] +# if {$idx < 0} { set isolcpus no_isolcpus - } else { - set tmp [string range $cmdline $idx end] - set tmp "$tmp " ;# add trailing blank - set isolcpus [string range $tmp 0 [expr -1 + [string first " " $tmp]]] - } - set fd [open /proc/cpuinfo] - while {![eof $fd]} { - gets $fd newline - set s [split $newline :] - set key [string trim [lindex $s 0]] - set key [string map "\" \" _" $key] - set v [lindex $s 1] - set procinfo($key) $v - } - close $fd +# } else { +# set tmp [string range $cmdline $idx end] +# set tmp "$tmp " ;# add trailing blank +# set isolcpus [string range $tmp 0 [expr -1 + [string first " " $tmp]]] +# } +# set fd [open /proc/cpuinfo] +# while {![eof $fd]} { +# gets $fd newline +# set s [split $newline :] +# set key [string trim [lindex $s 0]] +# set key [string map "\" \" _" $key] +# set v [lindex $s 1] +# set procinfo($key) $v +# } +# close $fd set cores "1_core" catch {set cores "$procinfo(cpu_cores) cores"};# item may not exist @@ -297,17 +297,17 @@ proc load_packages {} { exit 1 } - if [info exists ::LH(rtai)] { - if [catch {exec lsmod | grep rtai} msg] { - # puts ok_to_start_rtai - } else { - popup "RTAI is already running, (try: \$ halrun -U)" - exit 1 - } - exec $::LH(realtime) start & - progress "Delay for realtime startup" - after 1000 ;# wait to load Hal package - } +# if [info exists ::LH(rtai)] { +# if [catch {exec | grep rtai} msg] { +# # puts ok_to_start_rtai +# } else { +# popup "RTAI is already running, (try: \$ halrun -U)" +# exit 1 +# } +# exec $::LH(realtime) start & +# progress "Delay for realtime startup" +# after 1000 ;# wait to load Hal package +# } # augment ::auto_path for special case: # 1) RIP build (no install)