Files
mercury/tools/avg_frame_size
Zoltan Somogyi 47a1a02a92 Add vim modelines to most tools.
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.
2021-04-27 03:54:27 +10:00

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;
}