From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116960 invoked by alias); 6 Nov 2015 22:05:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 116948 invoked by uid 89); 6 Nov 2015 22:05:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 06 Nov 2015 22:05:46 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id C8D93264B; Fri, 6 Nov 2015 22:05:44 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-107.phx2.redhat.com [10.3.113.107]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA6M5hLX002664; Fri, 6 Nov 2015 17:05:43 -0500 Subject: Re: [sched] Dump dependency graph to a dot file To: Nikolai Bozhenov , Kyrill Tkachov , gcc-patches@gcc.gnu.org References: <563B1351.1050607@samsung.com> <563B1ECB.8050807@arm.com> <563B2EE3.6060904@samsung.com> Cc: vmakarov@redhat.com, meissner@linux.vnet.ibm.com, bschmidt@redhat.com, jim.wilson@linaro.org From: Jeff Law Message-ID: <563D2437.6070408@redhat.com> Date: Fri, 06 Nov 2015 22:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <563B2EE3.6060904@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00744.txt.bz2 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. /* . */. >> >> 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 > > * 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