diff options
author | jmg <jmg@FreeBSD.org> | 2004-07-27 00:36:53 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2004-07-27 00:36:53 +0000 |
commit | 90290e8fb7f8cb40d89b8c69b4744a8af26e087d (patch) | |
tree | a1cb616e86817f72d8add2a22e5008ec5ca3f6fd | |
parent | 559d01a8d6638255e442e6c0b4f12f17cf4757d0 (diff) | |
download | FreeBSD-src-90290e8fb7f8cb40d89b8c69b4744a8af26e087d.zip FreeBSD-src-90290e8fb7f8cb40d89b8c69b4744a8af26e087d.tar.gz |
add a command to calculate the ratios of cnt_hold and cnt_lock to locks
from mutex profiling... This takes cnt_* and divides it by count, so
lower is better...
Sample command:
sh mtxpercent.sh | sort -rn +7 -8
SEE ALSO
MUTEX_PROFILING(9)
-rw-r--r-- | tools/tools/mtxstat/mtxratio.sh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/tools/mtxstat/mtxratio.sh b/tools/tools/mtxstat/mtxratio.sh new file mode 100644 index 0000000..02a66a9 --- /dev/null +++ b/tools/tools/mtxstat/mtxratio.sh @@ -0,0 +1,2 @@ +# $FreeBSD$ +sysctl debug.mutex.prof.stats | awk '$1 ~ /[0-9]+/ { if ($3 != 0) { hld_prc = $5 / $3 * 100; lck_prc = $6 / $3 * 100 } else { hld_prc = 0; lck_prc = 0 } print $1 " " $2 " " $3 " " $4 " " $5 " " hld_prc " " $6 " " lck_prc " " substr($0, index($0, $7)); next } { print }' |