This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][RFC] Statistics "infrastructure"
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sun, 16 Mar 2008 00:05:29 +0100
- Subject: Re: [PATCH][RFC] Statistics "infrastructure"
- References: <Pine.LNX.firstname.lastname@example.org>
> This is an attempt to provide (pass) statistics collection. The
> goal is to provide infrastructure to handle the current (pass specific)
> statistics dumping that is done per function and per pass along the
> regular tree/rtl dumps as well as to allow CU wide "fancy" analysis.
> The most important aspect I think is simplicity to use it and especially
> add new "counters". Thus, we simply associate a counter with a string ID.
> The patch is a rough implementation of the current features of
> pass specific statistics plus a global "log" with statistics events.
> In the end you can do any postprocessing / globbing / summing of
> such global log.
> A statistics event consists of a function (optional), a statement
> (optional) and the counter ID. I converted the counters from
> tree-ssa-propagate.c as an example, instead of
> you now write
> statistics_add ("copy propagations");
> (function and statement omitted, you might prefer #defines for strings
> that you use multiple times).
it would perhaps be better to use #defines with integer values? Also,
it would be more consistent to have statistics.def similar to
timevar.def for this. It would make creation of new counters a bit
more difficult, but on the other hand, it would make it possible to
classify the counters (by type of the counted operation/its