From 9b84e7a8365e61211975aceec67d086aceee0c58 Mon Sep 17 00:00:00 2001 From: Rong Xu Date: Wed, 8 Oct 2014 21:51:41 +0000 Subject: Add overlap functionality to gcov-tool. 2014-10-08 Rong Xu * gcc/gcov-tool.c (profile_overlap): New driver function to compute profile overlap. (print_overlap_usage_message): New. (overlap_usage): New. (do_overlap): New. (print_usage): Add calls to overlap function. (main): Ditto. * libgcc/libgcov-util.c (read_gcda_file): Fix format. (find_match_gcov_info): Ditto. (calculate_2_entries): New. (compute_one_gcov): Ditto. (gcov_info_count_all_cold): Ditto. (gcov_info_count_all_zero): Ditto. (extract_file_basename): Ditto. (get_file_basename): Ditto. (set_flag): Ditto. (matched_gcov_info): Ditto. (calculate_overlap): Ditto. (gcov_profile_overlap): Ditto. * libgcc/libgcov-driver.c (compute_summary): Make it avavilable for external calls. * gcc/doc/gcov-tool.texi: Add documentation. From-SVN: r216015 --- gcc/doc/gcov-tool.texi | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'gcc/doc/gcov-tool.texi') diff --git a/gcc/doc/gcov-tool.texi b/gcc/doc/gcov-tool.texi index ff8b9e2..3a66872 100644 --- a/gcc/doc/gcov-tool.texi +++ b/gcc/doc/gcov-tool.texi @@ -103,8 +103,7 @@ in these kind of counters. @section Invoking @command{gcov-tool} @smallexample -gcov-tool @r{[}@var{global-options}@r{]} SUB_COMMAND -@r{[}@var{sub_command-options}@r{]} @var{profile_dir} +gcov-tool @r{[}@var{global-options}@r{]} SUB_COMMAND @r{[}@var{sub_command-options}@r{]} @var{profile_dir} @end smallexample @command{gcov-tool} accepts the following options: @@ -123,6 +122,15 @@ gcov-tool rewrite [rewrite-options] @var{directory} [@option{-o}|@option{--output} @var{directory}] [@option{-s}|@option{--scale} @var{float_or_simple-frac_value}] [@option{-n}|@option{--normalize} @var{long_long_value}] + +gcov-tool overlap [overlap-options] @var{directory1} @var{directory2} + [@option{-v}|@option{--verbose}] + [@option{-h}|@option{--hotonly}] + [@option{-f}|@option{--function}] + [@option{-F}|@option{--fullname}] + [@option{-o}|@option{--object}] + [@option{-t}|@option{--hot_threshold}] @var{float} + @c man end @c man begin SEEALSO gpl(7), gfdl(7), fsf-funding(7), gcc(1), gcov(1) and the Info entry for @@ -182,8 +190,42 @@ or simple fraction value form, such 1, 2, 2/3, and 5/3. @itemx --normalize Normalize the profile. The specified value is the max counter value in the new profile. +@end table + +@item overlap +Computer the overlap score between the two specified profile directories. +The overlap score is computed based on the arc profiles. It is defined as +the sum of min (p1_counter[i] / p1_sum_all, p2_counter[i] / p2_sum_all), +for all arc counter i, where p1_counter[i] and p2_counter[i] are two +matched counters and p1_sum_all and p2_sum_all are the sum of counter +values in profile 1 and profile 2, respectively. + +@table @gcctabopt +@item -v +@itemx --verbose +Set the verbose mode. + +@item -h +@itemx --hotonly +Only print info for hot objects/functions. +@item -f +@itemx --function +Print function level overlap score. + +@item -F +@itemx --fullname +Print full gcda filename. + +@item -o +@itemx --object +Print object level overlap score. + +@item -t @var{float} +@itemx --hot_threshold +Set the threshold for hot counter value. @end table + @end table @c man end -- cgit v1.1