GCC Middle and Back End API Reference
statistics.c File Reference

Data Structures

struct  statistics_counter_s
struct  stats_counter_hasher

Typedefs

typedef struct statistics_counter_s statistics_counter_t
typedef hash_table
< stats_counter_hasher
stats_counter_table_type

Functions

static stats_counter_table_type curr_statistics_hash ()
int statistics_fini_pass_1 (statistics_counter_t **slot, void *data)
int statistics_fini_pass_2 (statistics_counter_t **slot, void *data)
int statistics_fini_pass_3 (statistics_counter_t **slot, void *data)
void statistics_fini_pass ()
int statistics_fini_1 ()
void statistics_fini ()
void statistics_early_init ()
void statistics_init ()
static statistics_counter_tlookup_or_add_counter (stats_counter_table_type hash, const char *id, int val, bool histogram_p)
void statistics_counter_event ()
void statistics_histogram_event ()

Variables

static int statistics_dump_nr
static int statistics_dump_flags
static FILE * statistics_dump_file
static stats_counter_table_typestatistics_hashes
static unsigned nr_statistics_hashes

Typedef Documentation

Statistics entry.  A integer counter associated to a string ID
   and value.   

Function Documentation

static stats_counter_table_type curr_statistics_hash ( )
static
Return the current hashtable to be used for recording or printing
   statistics.   

References hash_table< Descriptor, Allocator >::create(), current_pass, memset(), nr_statistics_hashes, and opt_pass::static_pass_number.

Referenced by statistics_counter_event(), statistics_fini_pass(), and statistics_histogram_event().

static statistics_counter_t* lookup_or_add_counter ( stats_counter_table_type  hash,
const char *  id,
int  val,
bool  histogram_p 
)
static
Lookup or add a statistics counter in the hashtable HASH with ID, VAL
   and HISTOGRAM_P.   

References hash_table< Descriptor, Allocator >::find_slot(), statistics_counter_s::id, and statistics_counter_s::val.

Referenced by statistics_counter_event(), and statistics_histogram_event().

void statistics_early_init ( void  )
Register the statistics dump file.   

References dump_register(), and statistics_dump_nr.

Referenced by general_init().

void statistics_fini ( void  )
int statistics_fini_pass_1 ( statistics_counter_t **  slot,
void *  data 
)
Helper for statistics_fini_pass.  Print the counter difference
   since the last dump for the pass dump files.   

References statistics_counter_s::count, count, dump_file, statistics_counter_s::histogram_p, HOST_WIDE_INT, HOST_WIDE_INT_PRINT_DEC, statistics_counter_s::id, statistics_counter_s::prev_dumped_count, and statistics_counter_s::val.

Referenced by statistics_fini_pass().

int statistics_fini_pass_2 ( statistics_counter_t **  slot,
void *  data 
)
int statistics_fini_pass_3 ( statistics_counter_t **  slot,
void *  data 
)
Helper for statistics_fini_pass, reset the counters.   

References statistics_counter_s::count, and statistics_counter_s::prev_dumped_count.

Referenced by statistics_fini_pass().

void statistics_histogram_event ( )
Add statistics information about event ID in function FN with the
   histogram value VAL.
   It will dump the event to the global statistics file if requested.   

References statistics_counter_s::count, curr_statistics_hash(), current_pass, dump_flags, function_name(), statistics_counter_s::histogram_p, lookup_or_add_counter(), pass_data::name, opt_pass::static_pass_number, statistics_dump_file, and statistics_dump_flags.

Referenced by compute_antic(), insert(), and process_scc().

void statistics_init ( void  )

Variable Documentation

unsigned nr_statistics_hashes
static
int statistics_dump_nr
static
@verbatim Optimization statistics functions.

Copyright (C) 2008-2013 Free Software Foundation, Inc. Contributed by Richard Guenther rguen.nosp@m.ther.nosp@m.@suse.nosp@m..de

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.

Referenced by statistics_early_init(), statistics_fini(), and statistics_init().

stats_counter_table_type* statistics_hashes
static
Array of statistic hashes, indexed by pass id.