Dump histograms only if present.
2019-06-10 Martin Liska <mliska@suse.cz> * value-prof.c (dump_histogram_value): Print histogram values only if present. From-SVN: r272107
This commit is contained in:
parent
92d417175b
commit
6cea7e3976
@ -1,3 +1,8 @@
|
|||||||
|
2019-06-10 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
|
* value-prof.c (dump_histogram_value): Print histogram values
|
||||||
|
only if present.
|
||||||
|
|
||||||
2019-06-10 Martin Liska <mliska@suse.cz>
|
2019-06-10 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
* gcov-io.h (GCOV_DISK_SINGLE_VALUES): New.
|
* gcov-io.h (GCOV_DISK_SINGLE_VALUES): New.
|
||||||
|
@ -228,38 +228,36 @@ dump_histogram_value (FILE *dump_file, histogram_value hist)
|
|||||||
switch (hist->type)
|
switch (hist->type)
|
||||||
{
|
{
|
||||||
case HIST_TYPE_INTERVAL:
|
case HIST_TYPE_INTERVAL:
|
||||||
|
if (hist->hvalue.counters)
|
||||||
|
{
|
||||||
fprintf (dump_file, "Interval counter range %d -- %d",
|
fprintf (dump_file, "Interval counter range %d -- %d",
|
||||||
hist->hdata.intvl.int_start,
|
hist->hdata.intvl.int_start,
|
||||||
(hist->hdata.intvl.int_start
|
(hist->hdata.intvl.int_start
|
||||||
+ hist->hdata.intvl.steps - 1));
|
+ hist->hdata.intvl.steps - 1));
|
||||||
if (hist->hvalue.counters)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
fprintf (dump_file, " [");
|
fprintf (dump_file, " [");
|
||||||
for (i = 0; i < hist->hdata.intvl.steps; i++)
|
for (i = 0; i < hist->hdata.intvl.steps; i++)
|
||||||
fprintf (dump_file, " %d:%" PRId64,
|
fprintf (dump_file, " %d:%" PRId64,
|
||||||
hist->hdata.intvl.int_start + i,
|
hist->hdata.intvl.int_start + i,
|
||||||
(int64_t) hist->hvalue.counters[i]);
|
(int64_t) hist->hvalue.counters[i]);
|
||||||
fprintf (dump_file, " ] outside range:%" PRId64,
|
fprintf (dump_file, " ] outside range:%" PRId64 ".\n",
|
||||||
(int64_t) hist->hvalue.counters[i]);
|
(int64_t) hist->hvalue.counters[i]);
|
||||||
}
|
}
|
||||||
fprintf (dump_file, ".\n");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HIST_TYPE_POW2:
|
case HIST_TYPE_POW2:
|
||||||
fprintf (dump_file, "Pow2 counter ");
|
|
||||||
if (hist->hvalue.counters)
|
if (hist->hvalue.counters)
|
||||||
{
|
fprintf (dump_file, "Pow2 counter pow2:%" PRId64
|
||||||
fprintf (dump_file, "pow2:%" PRId64
|
" nonpow2:%" PRId64 ".\n",
|
||||||
" nonpow2:%" PRId64,
|
|
||||||
(int64_t) hist->hvalue.counters[1],
|
(int64_t) hist->hvalue.counters[1],
|
||||||
(int64_t) hist->hvalue.counters[0]);
|
(int64_t) hist->hvalue.counters[0]);
|
||||||
}
|
|
||||||
fprintf (dump_file, ".\n");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HIST_TYPE_SINGLE_VALUE:
|
case HIST_TYPE_SINGLE_VALUE:
|
||||||
case HIST_TYPE_INDIR_CALL:
|
case HIST_TYPE_INDIR_CALL:
|
||||||
|
if (hist->hvalue.counters)
|
||||||
|
{
|
||||||
fprintf (dump_file,
|
fprintf (dump_file,
|
||||||
(hist->type == HIST_TYPE_SINGLE_VALUE
|
(hist->type == HIST_TYPE_SINGLE_VALUE
|
||||||
? "Single value counter " : "Indirect call counter"));
|
? "Single value counter " : "Indirect call counter"));
|
||||||
@ -275,40 +273,29 @@ dump_histogram_value (FILE *dump_file, histogram_value hist)
|
|||||||
if (i != GCOV_DISK_SINGLE_VALUES - 1)
|
if (i != GCOV_DISK_SINGLE_VALUES - 1)
|
||||||
fprintf (dump_file, ", ");
|
fprintf (dump_file, ", ");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
fprintf (dump_file, ".\n");
|
fprintf (dump_file, ".\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HIST_TYPE_AVERAGE:
|
case HIST_TYPE_AVERAGE:
|
||||||
fprintf (dump_file, "Average value ");
|
|
||||||
if (hist->hvalue.counters)
|
if (hist->hvalue.counters)
|
||||||
{
|
fprintf (dump_file, "Average value sum:%" PRId64
|
||||||
fprintf (dump_file, "sum:%" PRId64
|
" times:%" PRId64 ".\n",
|
||||||
" times:%" PRId64,
|
|
||||||
(int64_t) hist->hvalue.counters[0],
|
(int64_t) hist->hvalue.counters[0],
|
||||||
(int64_t) hist->hvalue.counters[1]);
|
(int64_t) hist->hvalue.counters[1]);
|
||||||
}
|
|
||||||
fprintf (dump_file, ".\n");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HIST_TYPE_IOR:
|
case HIST_TYPE_IOR:
|
||||||
fprintf (dump_file, "IOR value ");
|
|
||||||
if (hist->hvalue.counters)
|
if (hist->hvalue.counters)
|
||||||
{
|
fprintf (dump_file, "IOR value ior:%" PRId64 ".\n",
|
||||||
fprintf (dump_file, "ior:%" PRId64,
|
|
||||||
(int64_t) hist->hvalue.counters[0]);
|
(int64_t) hist->hvalue.counters[0]);
|
||||||
}
|
|
||||||
fprintf (dump_file, ".\n");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HIST_TYPE_TIME_PROFILE:
|
case HIST_TYPE_TIME_PROFILE:
|
||||||
fprintf (dump_file, "Time profile ");
|
|
||||||
if (hist->hvalue.counters)
|
if (hist->hvalue.counters)
|
||||||
{
|
fprintf (dump_file, "Time profile time:%" PRId64 ".\n",
|
||||||
fprintf (dump_file, "time:%" PRId64,
|
|
||||||
(int64_t) hist->hvalue.counters[0]);
|
(int64_t) hist->hvalue.counters[0]);
|
||||||
}
|
|
||||||
fprintf (dump_file, ".\n");
|
|
||||||
break;
|
break;
|
||||||
case HIST_TYPE_MAX:
|
case HIST_TYPE_MAX:
|
||||||
gcc_unreachable ();
|
gcc_unreachable ();
|
||||||
|
Loading…
Reference in New Issue
Block a user