Files
mercury/tools/ctor_rep_stats
Zoltan Somogyi 463d2cbced Add an overall percentage display, and use a float format for counts
Estimated hours taken: 0.1

tools/ctor_rep_stats:
	Add an overall percentage display, and use a float format for counts
	to avoid clipping at 2^31-1(!).
1999-10-10 02:53:06 +00:00

19 lines
386 B
Awk
Executable File

#!/usr/bin/awk -f
{
rep[$2] = 1;
all += $3;
pred[$1] += $3;
kind[$1 "-" $2] += $3;
}
END {
for (p in pred)
{
for (r in rep)
{
printf "%-8s %-20s %15.0f (%5.2f%%, %5.2f%%)\n", p, r ":", kind[p "-" r], (100 * kind[p "-" r]) / pred[p], (100 * kind[p "-" r]) / all;
}
printf "%-29s %15.0f (%7s %5.2f%%)\n\n", p ":", pred[p], "", (100 * pred[p]) / all;
}
}