public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Add --devel-dump-pus
Date: Wed, 01 Jan 2020 00:00:00 -0000	[thread overview]
Message-ID: <20200109142054.GA3681@delia> (raw)

Hi,

Add an option --devel-dump-pus to print information about which duplicate
chains have been selected by partition_dups to be copied into partial units.

Output looks like this:
...
$ dwz hello --devel-dump-pus
Partial unit (phase one):
 60 O 6649b943 6649b943 long unsigned int base_type
 75 O e00eb67a e00eb67a int base_type
 81 O 7df8cdbf 7df8cdbf long int base_type
 88 O 6fe25160 6fe25160 char base_type
Partial unit (phase one):
 4b O 6737a1ef 6737a1ef unsigned char base_type
 52 O 168f1291 168f1291 short unsigned int base_type
 59 O 8b473491 8b473491 unsigned int base_type
 67 O 4ab0f4e6 4ab0f4e6 signed char base_type
 6e O 8a462495 8a462495 short int base_type
...

Committed to trunk.

Thanks,
- Tom

Add --devel-dump-pus

2020-01-09  Tom de Vries  <tdevries@suse.de>

	* dwz.c (dump_pus_p): New variable.
	(partition_dups_1): Handle dump_pus_p.
	(dwz_options, usage): Add dump_pus_p entry.

---
 dwz.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dwz.c b/dwz.c
index 99ef704..0087ac7 100644
--- a/dwz.c
+++ b/dwz.c
@@ -190,6 +190,7 @@ static int ignore_size;
 static int ignore_locus;
 static int dump_dies_p;
 static int dump_dups_p;
+static int dump_pus_p;
 static int verify_dups_p;
 static int verify_edge_freelist;
 static int stats_p;
@@ -199,6 +200,7 @@ static int stats_p;
 #define ignore_locus 0
 #define dump_dies_p 0
 #define dump_dups_p 0
+#define dump_pus_p 0
 #define verify_dups_p 0
 #define stats_p 0
 #endif
@@ -6819,6 +6821,9 @@ partition_dups_1 (dw_die_ref *arr, size_t vec_size,
 	      else
 		stats->pu_ph2_cnt++;
 	    }
+	  if (dump_pus_p)
+	    fprintf (stderr, "Partial unit (%s):\n",
+		     second_phase ? "phase two" : "phase one");
 	  partial_cu->cu_kind = CU_PU;
 	  partial_cu->cu_offset = *last_partial_cu == NULL
 				  ? 0 : (*last_partial_cu)->cu_offset + 1;
@@ -6848,6 +6853,8 @@ partition_dups_1 (dw_die_ref *arr, size_t vec_size,
 		continue;
 	      if (odr && odr_mode != ODR_BASIC)
 		arr[k] = reorder_dups (arr[k]);
+	      if (dump_pus_p)
+		dump_die (arr[k]);
 	      child = copy_die_tree (die, arr[k]);
 	      if (stats_p)
 		stats->pu_toplevel_die_cnt++;
@@ -14310,6 +14317,7 @@ static struct option dwz_options[] =
   { "devel-save-temps",  no_argument,	    &save_temps, 1 },
   { "devel-dump-dies",  no_argument,	    &dump_dies_p, 1 },
   { "devel-dump-dups",  no_argument,	    &dump_dups_p, 1 },
+  { "devel-dump-pus",  no_argument,	    &dump_pus_p, 1 },
   { "devel-unoptimized-multifile",
 			 no_argument,	    &unoptimized_multifile, 1 },
   { "devel-verify-edges",no_argument,	    &verify_edges_p, 1 },
@@ -14555,6 +14563,7 @@ usage (void)
        "  --devel-ignore-locus\n"
        "  --devel-save-temps\n"
        "  --devel-dump-dies\n"
+       "  --devel-dump-dups\n"
        "  --devel-unoptimized-multifile\n"
        "  --devel-verify-dups\n"
        "  --devel-verify-edges\n"

                 reply	other threads:[~2020-01-09 14:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200109142054.GA3681@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).