From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16256 invoked by alias); 10 Jan 2014 03:56:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 16244 invoked by uid 89); 10 Jan 2014 03:56:05 -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,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-qa0-f45.google.com Received: from mail-qa0-f45.google.com (HELO mail-qa0-f45.google.com) (209.85.216.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 10 Jan 2014 03:56:03 +0000 Received: by mail-qa0-f45.google.com with SMTP id j5so3603040qaq.18 for ; Thu, 09 Jan 2014 19:56:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RRxDkJ1Ckn9LdBoncIoYQhlPIvGuiNKkZE3w23BugcM=; b=aI6CYeRDIj/WtaeHizyrEBwBpPAl1TEnWhjcrS86gK8tPkLMgin7ToDwvkSTV/KliR yIMGTwqRGfoLlntKT30C7cCOHuYtSA6iiGZ2dkRc7QWMPOuejxEP3Dwpbe1+l8JJk9++ 7Q7BU4O2xOkvtIPd0CUbhAOCVeP+iCdQjv6f+vzCn8L+XHXpvZRE8QT7j+xfkuYjHX6l Nd6XgPh6AqoEPJBHEz4gnUeQIMfgd8cslioBN16r/Ek28wI1PL7jlByL3iSCtBnjXP3W Cq/FG314tRBMbYXl4y3hTQ4dylkQahsBXMWlnDPasiBrjKu31JgYOzUEoJct8cdMMnVZ keaA== X-Gm-Message-State: ALoCoQkfnbtAQf1kQUdmiVW8xGQdjt4R0DudgMpAETX4uoWPIpkexiltQNLUkrFsxT3mXvSb4NdQ X-Received: by 10.224.10.196 with SMTP id q4mr2678001qaq.74.1389326161177; Thu, 09 Jan 2014 19:56:01 -0800 (PST) Received: from localhost.localdomain (ool-4353a9c4.dyn.optonline.net. [67.83.169.196]) by mx.google.com with ESMTPSA id l4sm6585386qeh.23.2014.01.09.19.55.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jan 2014 19:56:00 -0800 (PST) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH] Have regdat.sh always rewrite the output register file Date: Fri, 10 Jan 2014 03:56:00 -0000 Message-Id: <1389326150-14874-1-git-send-email-patrick@parcs.ath.cx> X-SW-Source: 2014-01/txt/msg00269.txt.bz2 The rules for generating the output register files look like: amd64.c : $(srcdir)/../regformats/i386/amd64.dat $(regdat_sh) $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64.dat amd64.c According to this rule, if regdat.sh is newer than amd64.c, then regdat.sh shall be invoked on amd64.dat. According to regdat.sh, if the script determines that the output file amd64.c has not changed, then it will not overwrite the existing output file. This means that a subsequent invocation of make will trigger the above rule again as regdat.sh will be perpetually newer than amd64.c. This then shows up in the make output like so: /bin/bash ./../regformats/regdat.sh ./../regformats/i386/amd64-linux.dat amd64-linux.c amd64-linux.c unchanged. /bin/bash ./../regformats/regdat.sh ./../regformats/i386/amd64-avx-linux.dat amd64-avx-linux.c amd64-avx-linux.c unchanged. ... To fix this pathological behavior, it suffices to have regdat.sh unconditionally rewrite the output register file. On my machine, which has a regdat.sh file that is newer than some of the input register files, this change speeds up every invocation of make under gdb/ by about 5 seconds. --- gdb/ChangeLog | 4 ++++ gdb/regformats/regdat.sh | 14 +------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e878efa..cdd6616 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-01-10 Patrick Palka + + * regformats/regdat.sh: Always rewrite the register file. + 2014-01-02 Patrick Palka PR gdb/16120 diff --git a/gdb/regformats/regdat.sh b/gdb/regformats/regdat.sh index 0cf4588..fabc910 100755 --- a/gdb/regformats/regdat.sh +++ b/gdb/regformats/regdat.sh @@ -18,18 +18,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -move_if_change () -{ - file=$1 - if test -r ${file} && cmp -s "${file}" new-"${file}" - then - echo "${file} unchanged." 1>&2 - else - mv new-"${file}" "${file}" - echo "${file} updated." 1>&2 - fi -} - # Format of the input files read="type entry" @@ -202,4 +190,4 @@ EOF # close things off exec 1>&2 -move_if_change $2 +mv -- "new-$2" "$2" -- 1.8.5.2