diff mbox

IPA: enhance dump output

Message ID 542e230f-2966-ded6-d894-26ce17d0d7fb@suse.cz
State New
Headers show

Commit Message

Martin Liška Feb. 2, 2017, 1:20 p.m. UTC
Following patch was helpful to deal with the PR.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed or is it stage1 material?
Martin

Comments

Jan Hubicka Feb. 2, 2017, 2:54 p.m. UTC | #1
> 2017-01-24  Martin Liska  <mliska@suse.cz>
> 
> 	* cgraph.c (cgraph_node::dump): Dump function version info.
> 	* symtab.c (symtab_node::dump_base): Add missing new line.
> ---
>  gcc/cgraph.c | 10 ++++++++++
>  gcc/symtab.c |  1 +
>  2 files changed, 11 insertions(+)
> 
> diff --git a/gcc/cgraph.c b/gcc/cgraph.c
> index ef2dc50282c..74839f7d993 100644
> --- a/gcc/cgraph.c
> +++ b/gcc/cgraph.c
> @@ -2066,6 +2066,16 @@ cgraph_node::dump (FILE *f)
>      fprintf (f, "  Profile id: %i\n",
>  	     profile_id);
>    fprintf (f, "  First run: %i\n", tp_first_run);
> +  cgraph_function_version_info *vi = function_version ();
> +  if (vi != NULL)
> +    {
> +      /* Iterate to first item in the chain.  */
> +      while (vi->prev != NULL)
> +	vi = vi->prev;
> +      fprintf (f, "  Version info: ");
> +      dump_addr (f, "@", (void *)vi);
> +      fprintf (f, "\n");

I suppose it is useful to know that version info is attached, but instead of
dumping an address, i would rather meaningfully print its contents (i.e.
dispatcher and prev/next pointers in list).

OK with that change.

honza
> +    }
>    fprintf (f, "  Function flags:");
>    if (count)
>      fprintf (f, " executed %" PRId64"x",
> diff --git a/gcc/symtab.c b/gcc/symtab.c
> index 87febdc212f..0078896c8a8 100644
> --- a/gcc/symtab.c
> +++ b/gcc/symtab.c
> @@ -890,6 +890,7 @@ symtab_node::dump_base (FILE *f)
>      {
>        fprintf (f, "  Aux:");
>        dump_addr (f, " @", (void *)aux);
> +      fprintf (f, "\n");
>      }
>  
>    fprintf (f, "  References: ");
> -- 
> 2.11.0
>
diff mbox

Patch

From dc02af2bbbe67d9d1fb6119b606b3c1fea726062 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 24 Jan 2017 13:33:58 +0100
Subject: [PATCH] IPA: enhance dump output

gcc/ChangeLog:

2017-01-24  Martin Liska  <mliska@suse.cz>

	* cgraph.c (cgraph_node::dump): Dump function version info.
	* symtab.c (symtab_node::dump_base): Add missing new line.
---
 gcc/cgraph.c | 10 ++++++++++
 gcc/symtab.c |  1 +
 2 files changed, 11 insertions(+)

diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index ef2dc50282c..74839f7d993 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2066,6 +2066,16 @@  cgraph_node::dump (FILE *f)
     fprintf (f, "  Profile id: %i\n",
 	     profile_id);
   fprintf (f, "  First run: %i\n", tp_first_run);
+  cgraph_function_version_info *vi = function_version ();
+  if (vi != NULL)
+    {
+      /* Iterate to first item in the chain.  */
+      while (vi->prev != NULL)
+	vi = vi->prev;
+      fprintf (f, "  Version info: ");
+      dump_addr (f, "@", (void *)vi);
+      fprintf (f, "\n");
+    }
   fprintf (f, "  Function flags:");
   if (count)
     fprintf (f, " executed %" PRId64"x",
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 87febdc212f..0078896c8a8 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -890,6 +890,7 @@  symtab_node::dump_base (FILE *f)
     {
       fprintf (f, "  Aux:");
       dump_addr (f, " @", (void *)aux);
+      fprintf (f, "\n");
     }
 
   fprintf (f, "  References: ");
-- 
2.11.0