From 90290e8fb7f8cb40d89b8c69b4744a8af26e087d Mon Sep 17 00:00:00 2001 From: jmg Date: Tue, 27 Jul 2004 00:36:53 +0000 Subject: 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) --- tools/tools/mtxstat/mtxratio.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tools/tools/mtxstat/mtxratio.sh (limited to 'tools/tools/mtxstat') 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 }' -- cgit v1.1