* [committed] Print estimate usage and estimation error with --devel-trace
@ 2019-01-01 0:00 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01 0:00 UTC (permalink / raw)
To: dwz, jakub
Hi,
Be verbose in --devel-trace about using estimates, and print actual DIE count
together with estimation error.
Changes for low-mem mode:
...
$ dwz cc1 -o 1 --devel-trace
Compressing cc1
+Using die count estimate 10138840 to decide whether to count DIEs: yes
Counting DIEs
Hit low-mem die-limit
Compressing cc1 in low-mem mode
htab: off_htab allocation
size: 131071
+Die count: 10188941, 100.49% of estimate
htab: off_htab post-parsing
size: 16777213
elements (incl. deleted): 6536209, occupancy: 0.389588
elements (excl. deleted): 1760770, occupancy: 0.104950
searches: 47219770, collisions: 0.134397
htab: off_htab final
size: 16777213
elements (incl. deleted): 6536209, occupancy: 0.389588
elements (excl. deleted): 1760770, occupancy: 0.104950
searches: 75171859, collisions: 0.310610
...
Changes for regular mode:
...
$ dwz cc1 -o 1 --devel-trace -lnone
Compressing cc1
+Using die count estimate 10138840 to decide whether to count DIEs: no
+Using die count estimate 10138840 for off_htab allocation
htab: off_htab allocation
size: 16777213
+Die count: 10188941, 100.49% of estimate
htab: off_htab post-parsing
size: 16777213
elements: 10188941, occupancy: 0.607308
searches: 27075041, collisions: 0.207744
htab: off_htab final
size: 16777213
elements: 10188941, occupancy: 0.607308
searches: 34256212, collisions: 0.206357
...
Committed to trunk.
Thanks,
- Tom
Print estimate usage and estimation error with --devel-trace
2019-11-28 Tom de Vries <tdevries@suse.de>
* dwz.c (off_htab_add_die): Print when using estimate.
(read_debug_info): Same. Also keep ndies count for op_multifile. Print
total die count, and estimation error.
---
dwz.c | 43 ++++++++++++++++++++++++++++++++++---------
1 file changed, 34 insertions(+), 9 deletions(-)
diff --git a/dwz.c b/dwz.c
index e4b2548..3c886d6 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1335,11 +1335,21 @@ off_htab_add_die (dw_cu_ref cu, dw_die_ref die, unsigned int *die_count)
{
size_t nr_dies;
if (die_count && *die_count != 0)
- nr_dies = *die_count;
+ {
+ nr_dies = *die_count;
+ if (tracing)
+ fprintf (stderr, "Using die count %zu for off_htab"
+ " allocation\n", nr_dies);
+ }
else if (die_count_method == none)
nr_dies = 0;
else if (die_count_method == estimate)
- nr_dies = estimated_nr_dies;
+ {
+ nr_dies = estimated_nr_dies;
+ if (tracing)
+ fprintf (stderr, "Using die count estimate %zu for off_htab"
+ " allocation\n", nr_dies);
+ }
else
assert (false);
@@ -5118,13 +5128,20 @@ read_debug_info (DSO *dso, int kind, unsigned int *die_count)
unsigned int estimated_nr_dies = estimate_nr_dies ();
if (kind == DEBUG_INFO
&& multifile_mode == 0
- && die_count_method == estimate
- && (estimated_nr_dies > max_die_limit
- || estimated_nr_dies > low_mem_die_limit))
+ && die_count_method == estimate)
{
- int try_ret = try_debug_info (dso);
- if (try_ret != 0)
- return try_ret;
+ bool do_count = (estimated_nr_dies > max_die_limit
+ || estimated_nr_dies > low_mem_die_limit);
+ if (tracing)
+ fprintf (stderr, "Using die count estimate %u to decide whether to"
+ " count DIEs: %s\n", estimated_nr_dies,
+ do_count ? "yes" : "no");
+ if (do_count)
+ {
+ int try_ret = try_debug_info (dso);
+ if (try_ret != 0)
+ return try_ret;
+ }
}
if (likely (!fi_multifile && kind != DEBUG_TYPES))
@@ -5383,8 +5400,8 @@ read_debug_info (DSO *dso, int kind, unsigned int *die_count)
ret = 2;
goto fail;
}
- ndies++;
}
+ ndies++;
if (unlikely (low_mem_phase1))
die = &die_buf;
else if (parent == NULL
@@ -5740,6 +5757,14 @@ read_debug_info (DSO *dso, int kind, unsigned int *die_count)
return 0;
}
+ if (tracing)
+ {
+ if (op_multifile)
+ fprintf (stderr, "Die count: %u\n", ndies);
+ else
+ fprintf (stderr, "Die count: %u, %.2f%% of estimate\n", ndies,
+ (double)ndies / ((double)estimated_nr_dies / 100));
+ }
if (tracing)
htab_report (off_htab, "off_htab post-parsing");
if (die_count)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-11-28 16:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01 0:00 [committed] Print estimate usage and estimation error with --devel-trace Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).