Listing 2: Simple gprof output filter
BEGIN {
foundff = 0;
igno = 0;
}
/* the space at the beginning of the regexp is necessary */
/* to avoid matching,for instance, every function ending */
/* in done */
/ <hicore>$/ { igno = 1; }
/ <locore>$/ { igno = 1; }
/ __do_global_ctors_aux$/ { igno = 1; }
/ __do_global_dtors_aux$/ { igno = 1; }
/ _mcleanup$/ { igno = 1; }
/ _profil_handler$/ { igno = 1; }
/ _start$/ { igno = 1; }
/ done$/ { igno = 1; }
/ fini_dummy$/ { igno = 1; }
/ init_dummy$/ { igno = 1; }
/ mcount$/ { igno = 1; }
/ moncontrol$/ { igno = 1; }
/ monstartup$/ { igno = 1; }
/ profil$/ { igno = 1; }
/\014/ { foundff = 1 }
{
if( ( igno == 0 ) && (foundff == 0) )
print;
igno = 0;
}
/*
End of file */