Process.dll
をテンプレートにして作成
[
Front page
] [
Page list
|
Search
|
Recent changes
|
RSS of recent changes
]
Start:
*** What is this? [#oe481973]
This package provides commands for show/kill process on W...
ps command can get some details such as %cpu, PPID, exe f...
*** License [#o750eabc]
BSD-Style License
*** Source & Binary [#yfe08456]
http://reddog.s35.xrea.com/software/process1.0.zip
*** Command [#k2d7e660]
ps ?options?
kill ?pid?
*** ps options [#cb116ea6]
- -exe ~
exefile name
- -path ~
exefile full path (long name)
- -ppid ~
parent process id
- -priority ~
priority base
- -thread ~
thread count
- -ctime ~
created datetime. If we cannot get it, it will be ''0''.
- -ktime ~
kernel time. If we cannot get it, it will be -1.
- -utime ~
user time. If we cannot get it, it will be -1.
- -%cpu ~
Percentage of CPU usage from created time to the present ...
- -%cpu msec ~
Percentage of CPU usage in milli seconds. If we cannot ge...
- -%size ~
Percentage of real memory (working set) used. If we cann...
- -%vsize ~
Percentage of virtual memory (page file) used. If we can...
- -size ~
real memory size (byte). If we cannot get it, it will be ...
- -peaksize ~
real memory peal size (byte). If we cannot get it, it wil...
- -vsize ~
virtual memory size (byte). If we cannot get it, it will ...
- -peakvsize~
virtual memory peak size (byte). If we cannot get it, it ...
- -pagefault ~
pagefault count. If we cannot get it, it will be -1.
- -user ~
account user name
- -domain ~
account domain name
- -version ~
exe version
- -plainlist ~
output plain list
*** Example1 [#ob241f99]
package require Process
# Show Process List
ps -exe -%cpu -%size
ps -exe -ppid
kill 1024
...
*** Example2 [#fa342965]
proc plist {} {
puts [format {%4s %-8s %6s %6s %5s %s} \
PID USER %CPU %MEM SIZE CMD]
foreach {pid user pcpu pmem mem exe} \
[ps -user -%cpu -%size -size -exe -plainlist] {
if {$pcpu < 0} {set pcpu 0}
if {$pmem < 0} {set pmem 0}
puts [format {%4d %-8s %6.1f%% %6.1f%% %5dKB %s} \
$pid $user $pcpu $pmem [expr $mem/1024] $exe]
}
}
plist
PID USER %CPU %MEM SIZE CMD
0 0.0% 0.0% -1KB [System Process]
8 0.0% 0.0% 252KB System
156 SYSTEM 0.0% 0.1% 436KB SMSS.EXE
180 0.0% 0.0% -1KB CSRSS.EXE
176 SYSTEM 0.0% 0.7% 3728KB WINLOGON.EXE
228 SYSTEM 0.0% 1.0% 5368KB SERVICES.EXE
240 SYSTEM 0.0% 0.2% 1056KB LSASS.EXE
420 SYSTEM 0.0% 0.5% 2600KB svchost.exe
448 SYSTEM 0.0% 0.6% 3348KB spoolsv.exe
484 SYSTEM 0.0% 1.0% 5360KB svchost.exe
512 SYSTEM 0.0% 0.7% 3616KB mdm.exe
624 SYSTEM 0.0% 0.6% 3064KB NAVAPSVC.EXE
...
***Example3 [#z44d4c20]
package require tablelist
package require Process
set lvar {}
button .update -text Update -command {
set lvar [ps -%cpu 500 -size -exe]
catch {.table sortbycolumn [.table sortcolumn] -[.table...
update
}
scrollbar .y -command {.table yview}
tablelist::tablelist .table -listvariable lvar \
-showarrow yes -yscrollcommand {.y set} \
-labelcommand tablelist::sortByColumn \
-columns {6 PID 10 %CPU 10 Memory 32 Name} -width 70
.table columnconfigure 0 -align right -sortmode integer
.table columnconfigure 1 -align right -sortmode real -fo...
.table columnconfigure 2 -align right -sortmode integer ...
.table columnconfigure 3 -sortmode ascii
pack .update -side bottom -fill x
pack .table -side left -expand yes -fill both
pack .y -side right -fill y
proc formatPer {var} {
if {$var < 0} {
return {}
}
return "[format %3.2f $var] %"
}
proc formatSize {var} {
if {$var < 0} {
return {}
}
return "[expr $var / 1024] KB"
}
#ref(process1.gif,nolink,left)
----
[[CategoryTclTk]] [[CategorySoft]]
[[Tclでプロセス管理]]
End:
*** What is this? [#oe481973]
This package provides commands for show/kill process on W...
ps command can get some details such as %cpu, PPID, exe f...
*** License [#o750eabc]
BSD-Style License
*** Source & Binary [#yfe08456]
http://reddog.s35.xrea.com/software/process1.0.zip
*** Command [#k2d7e660]
ps ?options?
kill ?pid?
*** ps options [#cb116ea6]
- -exe ~
exefile name
- -path ~
exefile full path (long name)
- -ppid ~
parent process id
- -priority ~
priority base
- -thread ~
thread count
- -ctime ~
created datetime. If we cannot get it, it will be ''0''.
- -ktime ~
kernel time. If we cannot get it, it will be -1.
- -utime ~
user time. If we cannot get it, it will be -1.
- -%cpu ~
Percentage of CPU usage from created time to the present ...
- -%cpu msec ~
Percentage of CPU usage in milli seconds. If we cannot ge...
- -%size ~
Percentage of real memory (working set) used. If we cann...
- -%vsize ~
Percentage of virtual memory (page file) used. If we can...
- -size ~
real memory size (byte). If we cannot get it, it will be ...
- -peaksize ~
real memory peal size (byte). If we cannot get it, it wil...
- -vsize ~
virtual memory size (byte). If we cannot get it, it will ...
- -peakvsize~
virtual memory peak size (byte). If we cannot get it, it ...
- -pagefault ~
pagefault count. If we cannot get it, it will be -1.
- -user ~
account user name
- -domain ~
account domain name
- -version ~
exe version
- -plainlist ~
output plain list
*** Example1 [#ob241f99]
package require Process
# Show Process List
ps -exe -%cpu -%size
ps -exe -ppid
kill 1024
...
*** Example2 [#fa342965]
proc plist {} {
puts [format {%4s %-8s %6s %6s %5s %s} \
PID USER %CPU %MEM SIZE CMD]
foreach {pid user pcpu pmem mem exe} \
[ps -user -%cpu -%size -size -exe -plainlist] {
if {$pcpu < 0} {set pcpu 0}
if {$pmem < 0} {set pmem 0}
puts [format {%4d %-8s %6.1f%% %6.1f%% %5dKB %s} \
$pid $user $pcpu $pmem [expr $mem/1024] $exe]
}
}
plist
PID USER %CPU %MEM SIZE CMD
0 0.0% 0.0% -1KB [System Process]
8 0.0% 0.0% 252KB System
156 SYSTEM 0.0% 0.1% 436KB SMSS.EXE
180 0.0% 0.0% -1KB CSRSS.EXE
176 SYSTEM 0.0% 0.7% 3728KB WINLOGON.EXE
228 SYSTEM 0.0% 1.0% 5368KB SERVICES.EXE
240 SYSTEM 0.0% 0.2% 1056KB LSASS.EXE
420 SYSTEM 0.0% 0.5% 2600KB svchost.exe
448 SYSTEM 0.0% 0.6% 3348KB spoolsv.exe
484 SYSTEM 0.0% 1.0% 5360KB svchost.exe
512 SYSTEM 0.0% 0.7% 3616KB mdm.exe
624 SYSTEM 0.0% 0.6% 3064KB NAVAPSVC.EXE
...
***Example3 [#z44d4c20]
package require tablelist
package require Process
set lvar {}
button .update -text Update -command {
set lvar [ps -%cpu 500 -size -exe]
catch {.table sortbycolumn [.table sortcolumn] -[.table...
update
}
scrollbar .y -command {.table yview}
tablelist::tablelist .table -listvariable lvar \
-showarrow yes -yscrollcommand {.y set} \
-labelcommand tablelist::sortByColumn \
-columns {6 PID 10 %CPU 10 Memory 32 Name} -width 70
.table columnconfigure 0 -align right -sortmode integer
.table columnconfigure 1 -align right -sortmode real -fo...
.table columnconfigure 2 -align right -sortmode integer ...
.table columnconfigure 3 -sortmode ascii
pack .update -side bottom -fill x
pack .table -side left -expand yes -fill both
pack .y -side right -fill y
proc formatPer {var} {
if {$var < 0} {
return {}
}
return "[format %3.2f $var] %"
}
proc formatSize {var} {
if {$var < 0} {
return {}
}
return "[expr $var / 1024] KB"
}
#ref(process1.gif,nolink,left)
----
[[CategoryTclTk]] [[CategorySoft]]
[[Tclでプロセス管理]]
Page:
HTML convert time: 0.004 sec.