2 * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief Statistics for Firm.
23 * @author Michael Beck
25 #ifndef FIRM_STAT_FIRMSTAT_H
26 #define FIRM_STAT_FIRMSTAT_H
28 #include "firm_types.h"
32 * Dump a snapshot of the statistic values.
33 * Never called from libFirm should be called from user.
35 * @param fname base name of the statistic output file
36 * @param phase a phase name. Prefix will be firmstat-\<phase\>-
38 FIRM_API void stat_dump_snapshot(const char *fname, const char *phase);
41 * Creates an ir_prog pass for stat_dump_snapshot().
43 * @param name the name of this pass or NULL
44 * @param fname base name of the statistic output file
45 * @param phase a phase name. Prefix will be firmstat-\<phase\>-
47 * @return the newly created ir_prog pass
49 FIRM_API ir_prog_pass_t *stat_dump_snapshot_pass(
50 const char *name, const char *fname, const char *phase);
53 * initialize the statistics module.
54 * Should be called directly after ir_init
56 FIRM_API void firm_init_stat(void);
59 * terminates the statistics module, frees all memory
61 FIRM_API void stat_term(void);
64 * returns 1 if statistic module is active, 0 otherwise
66 FIRM_API int stat_is_active(void);