Commit d1c772b9 by Martin Liska Committed by Martin Liska

GCOV: Print one decimal place in human readable mode.

2018-09-05  Martin Liska  <mliska@suse.cz>

	* doc/gcov.texi: Update documentation of humar
	readable mode.
	* gcov.c (format_count): Print one decimal place, it provides
	more fine number of situations like '1G' vs. '1.4G'.
2018-09-05  Martin Liska  <mliska@suse.cz>

	* g++.dg/gcov/loop.C: Update test to support new format.

From-SVN: r264112
parent 3d043c51
2018-09-05 Martin Liska <mliska@suse.cz>
* doc/gcov.texi: Update documentation of humar
readable mode.
* gcov.c (format_count): Print one decimal place, it provides
more fine number of situations like '1G' vs. '1.4G'.
2018-09-05 Martin Liska <mliska@suse.cz>
PR target/87164
* config/rs6000/rs6000.opt: Mark the option as Deprecated.
* optc-gen.awk: Allow 'Var' for Deprecated options in order
......
......@@ -255,7 +255,7 @@ lcount:36,1,0
@item -j
@itemx --human-readable
Write counts in human readable format (like 24k).
Write counts in human readable format (like 24.6k).
@item -k
@itemx --use-colors
......
......@@ -2216,8 +2216,8 @@ format_count (gcov_type count)
if (count + divisor / 2 < 1000 * divisor)
break;
}
gcov_type r = (count + divisor / 2) / divisor;
sprintf (buffer, "%" PRId64 "%c", r, units[i]);
float r = 1.0f * count / divisor;
sprintf (buffer, "%.1f%c", r, units[i]);
return buffer;
}
......
2018-09-05 Martin Liska <mliska@suse.cz>
* g++.dg/gcov/loop.C: Update test to support new format.
2018-09-04 H.J. Lu <hongjiu.lu@intel.com>
PR debug/86593
......
......@@ -2,11 +2,11 @@
/* { dg-do run { target native } } */
unsigned
loop (unsigned n, int value) /* count(14k) */
loop (unsigned n, int value) /* count(14.0k) */
{
for (unsigned i = 0; i < n - 1; i++)
{
value += i; /* count(21M) */
value += i; /* count(21.0M) */
}
return value;
......@@ -18,7 +18,7 @@ int main(int argc, char **argv)
for (unsigned i = 0; i < 7 * 1000; i++)
{
sum += loop (1000, sum);
sum += loop (2000, sum); /* count(7k) */
sum += loop (2000, sum); /* count(7.0k) */
}
return 0; /* count(1) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment