PERFORCE change 187811 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Fri Jan 14 20:16:51 UTC 2011
http://p4web.freebsd.org/@@187811?ac=10
Change 187811 by trasz at trasz_victim on 2011/01/14 20:16:33
Improve.
Affected files ...
.. //depot/projects/soc2009/trasz_limits/usr.bin/userstat/userstat.sh#6 edit
Differences ...
==== //depot/projects/soc2009/trasz_limits/usr.bin/userstat/userstat.sh#6 (text+ko) ====
@@ -58,10 +58,14 @@
# Put resource=value pairs into environment variables.
eval `rctl $hflag -u j:$jail`
- pctcpulimit=`rctl j:$jail:pctcpu:deny=/jail | sed 's/.*=//'`
- rsslimit=`rctl j:$jail:rss:deny=/jail | sed 's/.*=//'`
- vmemlimit=`rctl j:$jail:vmem:deny=/jail | sed 's/.*=//'`
- swaplimit=`rctl j:$jail:swap:deny=/jail | sed 's/.*=//'`
+ pctcpulimit=`rctl $hflag j:$jail:pctcpu:deny=/jail | sed 's/.*=//'`
+ : ${pctcpulimit:="-"}
+ rsslimit=`rctl $hflag j:$jail:rss:deny=/jail | sed 's/.*=//'`
+ : ${rsslimit:="-"}
+ vmemlimit=`rctl $hflag j:$jail:vmem:deny=/jail | sed 's/.*=//'`
+ : ${vmemlimit:="-"}
+ swaplimit=`rctl $hflag j:$jail:swap:deny=/jail | sed 's/.*=//'`
+ : ${swaplimit:="-"}
printf "%s\t\%s\t\%s\t\%s\t\%s\t\%s\t\%s\t\%s\t\%s\n" "$jail" "$pctcpu" "$pctcpulimit" "$rss" "$rsslimit" "$vmem" "$vmemlimit" "$swap" "$swaplimit"
done
@@ -73,10 +77,14 @@
# Put resource=value pairs into environment variables.
eval `rctl $hflag -u u:$user`
- pctcpulimit=`rctl u:$user:pctcpu:deny=/user | sed 's/.*=//'`
- rsslimit=`rctl u:$user:rss:deny=/user | sed 's/.*=//'`
- vmemlimit=`rctl u:$user:vmem:deny=/user | sed 's/.*=//'`
- swaplimit=`rctl u:$user:swap:deny=/user | sed 's/.*=//'`
+ pctcpulimit=`rctl $hflag u:$user:pctcpu:deny=/user | sed 's/.*=//'`
+ : ${pctcpulimit:="-"}
+ rsslimit=`rctl $hflag u:$user:rss:deny=/user | sed 's/.*=//'`
+ : ${rsslimit:="-"}
+ vmemlimit=`rctl $hflag u:$user:vmem:deny=/user | sed 's/.*=//'`
+ : ${vmemlimit:="-"}
+ swaplimit=`rctl $hflag u:$user:swap:deny=/user | sed 's/.*=//'`
+ : ${swaplimit:="-"}
printf "%s\t\%s\t\%s\t\%s\t\%s\t\%s\t\%s\t\%s\t\%s\n" "$user" "$pctcpu" "$pctcpulimit" "$rss" "$rsslimit" "$vmem" "$vmemlimit" "$swap" "$swaplimit"
done
More information about the p4-projects
mailing list