]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Improve colorization legend in gcov reports.
authorMartin Liska <mliska@suse.cz>
Mon, 24 Sep 2018 11:28:38 +0000 (13:28 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 24 Sep 2018 11:28:38 +0000 (11:28 +0000)
2018-09-24  Martin Liska  <mliska@suse.cz>

* gcov.c (output_lines): Print colorization legend
for both flag_use_colors and flag_use_hotness_colors.
Reword the help.

From-SVN: r264531

gcc/ChangeLog
gcc/gcov.c

index eb23c85358675c5c78f1bafb7f71de8b51dab72d..4b717a36b53f6c5c798e3f3e75e4f7b231278971 100644 (file)
@@ -1,3 +1,9 @@
+2018-09-24  Martin Liska  <mliska@suse.cz>
+
+       * gcov.c (output_lines): Print colorization legend
+       for both flag_use_colors and flag_use_hotness_colors.
+       Reword the help.
+
 2018-09-24  Martin Liska  <mliska@suse.cz>
 
        * coverage.c (get_coverage_counts): Use warning_at
index 922e2de2646bf37c0573ad28e49091341a307e03..e255e4e3922defa3fb1a0476067b8dacde2d872a 100644 (file)
@@ -2933,9 +2933,19 @@ output_lines (FILE *gcov_file, const source_info *src)
   FILE *source_file;
   const char *retval;
 
-  /* Print legend of color hotness syntax.  */
+  /* Print colorization legend.  */
+  if (flag_use_colors)
+    fprintf (gcov_file, "%s",
+            DEFAULT_LINE_START "Colorization: profile count: " \
+            SGR_SEQ (COLOR_BG_CYAN) "zero coverage (exceptional)" SGR_RESET \
+            " " \
+            SGR_SEQ (COLOR_BG_RED) "zero coverage (unexceptional)" SGR_RESET \
+            " " \
+            SGR_SEQ (COLOR_BG_MAGENTA) "unexecuted block" SGR_RESET "\n");
+
   if (flag_use_hotness_colors)
-    fprintf (gcov_file, "%s", DEFAULT_LINE_START "Hotness legend: " \
+    fprintf (gcov_file, "%s",
+            DEFAULT_LINE_START "Colorization: line numbers: hotness: " \
             SGR_SEQ (COLOR_BG_RED) "> 50%" SGR_RESET " " \
             SGR_SEQ (COLOR_BG_YELLOW) "> 20%" SGR_RESET " " \
             SGR_SEQ (COLOR_BG_GREEN) "> 10%" SGR_RESET "\n");