From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3300 invoked by alias); 14 Apr 2011 08:51:43 -0000 Received: (qmail 3287 invoked by uid 22791); 14 Apr 2011 08:51:41 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Apr 2011 08:51:37 +0000 Received: by wye20 with SMTP id 20so1429906wye.20 for ; Thu, 14 Apr 2011 01:51:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.172.7 with SMTP id j7mr530993wbz.60.1302771096278; Thu, 14 Apr 2011 01:51:36 -0700 (PDT) Received: by 10.227.0.140 with HTTP; Thu, 14 Apr 2011 01:51:35 -0700 (PDT) In-Reply-To: <20110413184308.GW23480@codesourcery.com> References: <20110412141626.GF23480@codesourcery.com> <20110412143205.GG23480@codesourcery.com> <20110412145143.GH23480@codesourcery.com> <20110412150901.GI23480@codesourcery.com> <20110413184308.GW23480@codesourcery.com> Date: Thu, 14 Apr 2011 08:51:00 -0000 Message-ID: Subject: Re: [PATCH] add statistics counting to postreload, copy-rename, and math-opts From: Richard Guenther To: Nathan Froyd Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2011-04/txt/msg01047.txt.bz2 On Wed, Apr 13, 2011 at 8:43 PM, Nathan Froyd wr= ote: > On Wed, Apr 13, 2011 at 11:07:15AM +0200, Richard Guenther wrote: >> On Tue, Apr 12, 2011 at 5:09 PM, Nathan Froyd = wrote: >> > Granted, but that fact should still be recorded. =A0The situation we h= ave >> > today, for something like: >> > >> > func1: statistic for "statx" was 0 >> > =A0- nothing is recorded in the statistics table >> > func2: statistic for "statx" was 0 >> > =A0- nothing is recorded in the statistics table >> > func3: statistic for "statx" was 0 >> > =A0- nothing is recorded in the statistics table >> > ... >> > >> > and so forth, is that at the end of the day, the dump file won't even >> > include any information about "statx". =A0If you had some func7387 whe= re >> > "statx" was non-zero, you could infer that nothing else happened in the >> > previous 7386 functions. =A0For the case where a pass is truly useless= on >> > a TU, it's hard to figure out from the statistics dump alone. =A0And I= 'd >> > argue that it's useful to see explicitly that the pass only helped in 1 >> > out of 7387 functions, rather than trying to infer it from missing dat= a. >> >> I always use statistics-stats (thus, overall stats, not per function). = =A0The >> per function ones omit zero counts during dumping on purpose >> (to make the dump smaller). > > I didn't know about statistics-stats (or didn't realize that's what the > code was trying to do), that's useful. =A0And it looks like all the > statistics dumping things omit zero counts on purpose, not just the > per-function ones. > > But that has no bearing on the point above: zero counts are not even > *recorded* today. =A0E.g. if you apply the patch upthread, grab a random C > file, compile it with -O2/3 -fdump-statistics/-stats, and examine the > dump file, you might not even know that new statistics counters have > been added. =A0Taking out the checks to avoid printing zero counts doesn't > help either, because the data simply doesn't get recorded. =A0This > infrastructure makes it somewhat difficult to figure out, in an > automated way from the dump file alone, whether passes are actually > doing anything. Oh, ok - now I understand what you are saying. Yes, that's by design and hard to fix - counters are "registered" on their first bump. > Enough grousing. =A0I'm assuming turning on accumulation and dumping of > zero counts always would be frowned upon; would it be acceptable to turn > accumulation and dumping of zero counts if -details is given? Well, you'd have to fix the registration problem ... But I don't see zero counts as very important, if not to verify that the statistics code is placed at a good spot. Richard. > -Nathan >