mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
tools/add_cont_lines:
tools/appears:
tools/assemble:
tools/avg_frame_size:
tools/build_srcdist:
tools/cleanint:
tools/compare_frame_sizes:
tools/configure_mingw_cross:
tools/cont:
tools/ctor_rep_stats:
tools/cur_param:
tools/dd_speedtest:
tools/divide:
tools/extract_dd_stats:
tools/file_name_translation_stats:
tools/frame_sizes:
tools/gdbrun:
tools/half:
tools/info_stats.awk:
tools/linear:
tools/lmc.in:
tools/mai_stats:
tools/make_arena:
tools/next_param:
tools/not:
tools/optstages:
tools/type_ctor_stats:
Add vim mode lines. Replace tabs with spaces.
24 lines
640 B
Awk
Executable File
24 lines
640 B
Awk
Executable File
#!/usr/bin/awk -f
|
|
# vim: ft=awk ts=4 sw=4 et
|
|
#
|
|
# Given a file generated by frame_sizes as its input, which has one line per
|
|
# procedure and gives the stack frame size of that procedure, this script
|
|
# computes and prints the average frame size.
|
|
{
|
|
if (NF != 5) {
|
|
printf "error: NF != 5\n"
|
|
printf "%s\n", $0;
|
|
next;
|
|
}
|
|
|
|
proc = $3 " " $4 " " $5;
|
|
framesize = $2;
|
|
|
|
frames += 1;
|
|
sizes += framesize;
|
|
}
|
|
END {
|
|
printf "number of procedures with frames: %d\n", frames;
|
|
printf "average number of words per frame: %5.2f\n", sizes / frames;
|
|
}
|