public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Nikolai Bozhenov <n.bozhenov@samsung.com>,
	       Kyrill Tkachov <kyrylo.tkachov@arm.com>,
	gcc-patches@gcc.gnu.org
Cc: vmakarov@redhat.com, meissner@linux.vnet.ibm.com,
	bschmidt@redhat.com,        jim.wilson@linaro.org
Subject: Re: [sched] Dump dependency graph to a dot file
Date: Fri, 06 Nov 2015 22:05:00 -0000	[thread overview]
Message-ID: <563D2437.6070408@redhat.com> (raw)
In-Reply-To: <563B2EE3.6060904@samsung.com>

On 11/05/2015 03:26 AM, Nikolai Bozhenov wrote:
> On 11/05/2015 12:18 PM, Kyrill Tkachov wrote:
>> Hi Nikolai,
>>
>> On 05/11/15 08:29, Nikolai Bozhenov wrote:
>>> Hi!
>>>
>>> The attached patch adds a procedure to dump the scheduler's dependency
>>> graph into a dot file. The patch has been bootstrapped and regtested
>>> on x86_64. Please commit if it is OK for trunk.
>>>
>>> Thanks,
>>> Nikolai
>>
>> A couple of style nits.
>>
>> +      // begin subgraph (basic block)
>> +      pp_printf (&pp, "subgraph cluster_block_%d {\n", bb);
>> +      pp_printf (&pp, "\t" "color=blue;" "\n");
>> +      pp_printf (&pp, "\t" "style=bold;" "\n");
>> +      pp_printf (&pp, "\t" "label=\"BB #%d\";\n", BB_TO_BLOCK (bb));
>> +
>> +      // setup head and tail (no support for EBBs)
>> +      gcc_assert (EBB_FIRST_BB (bb) == EBB_LAST_BB (bb));
>> +      get_ebb_head_tail (EBB_FIRST_BB (bb), EBB_LAST_BB (bb), &head,
>> &tail);
>> +      tail = NEXT_INSN (tail);
>> +
>> +      // dump all insns
>> +      for (con = head; con != tail; con = NEXT_INSN (con))
>> +    {
>> +      if (!INSN_P (con))
>> +        continue;
>> +
>> +      // pretty print the insn
>> +      pp_printf (&pp, "\t%d [label=\"{", INSN_UID (con));
>>
>> Please use C-style comments i.e. /**/ instead of //.
>> Also, throughout the comments leave two empty spaces after a full stop
>> i.e. /* <text>.  */.
>>
>> You can use the check_GNU_style.sh script in the contrib/ directory on
>> your patches to highlight similar issues. For example:
>> $ ./contrib/check_GNU_style.sh ~/patches/dep-graph.patch
>>
>> Dot, space, space, end of comment.
>> 83:+/* Dump dependency graph for the current region to a file using
>> dot syntax. */
>> 166:+/* Dump dependency graph for the current region to a file using
>> dot syntax. */
>>
>> Sentences should end with a dot.  Dot, space, space, end of the comment.
>> 127:+      /* dump all deps */
>>
>> Cheers,
>> Kyrill
>>
>>
> Thanks for your remarks, Kyrill!
>
> I've uploaded an updated patch.
>
> Nikolai
>
> dep-graph.patch
>
>
> 2015-11-04  Nikolai Bozhenov<n.bozhenov@samsung.com>
>
> 	* sched-int.h (dump_rgn_dependencies_dot): Declare
> 	* sched-rgn.c (dump_rgn_dependencies_dot): New function
> 	* print-rtl.h (print_insn): Add prototype
I was briefly worried about using the DOT format here.  There was a time 
when GraphViz was considered by the FSF to be non-free and thus using 
the DOT format was verboten.  That thankfully changed way back in 2005 :-)

With that out of the way, this patch is fine for the trunk.  Please install.

Thanks,
Jeff

      reply	other threads:[~2015-11-06 22:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05  8:29 Nikolai Bozhenov
2015-11-05  9:18 ` Kyrill Tkachov
2015-11-05 10:26   ` Nikolai Bozhenov
2015-11-06 22:05     ` Jeff Law [this message]

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=563D2437.6070408@redhat.com \
    --to=law@redhat.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jim.wilson@linaro.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=meissner@linux.vnet.ibm.com \
    --cc=n.bozhenov@samsung.com \
    --cc=vmakarov@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).