mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
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(!).
19 lines
386 B
Awk
Executable File
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;
|
|
}
|
|
}
|