Added some statistics events
[libfirm] / ir / be / beprofile.h
1 /** vim: set sw=4 ts=4:
2  * @file   beprofile.h
3  * @date   2006-04-06
4  * @author Adam M. Szalkowski
5  * @cvs-id $Id$
6  *
7  * Code instrumentation and execution count profiling
8  *
9  * Copyright (C) 2006 Universitaet Karlsruhe
10  * Released under the GPL
11  */
12
13 #ifndef _BEPROFILE_H_
14 #define _BEPROFILE_H_
15
16 /**
17  * Instruments irgs with profile code
18  * @param filename The name of the output file for the profile information
19  * @return The irg doing the profile initialization.
20  */
21 ir_graph * be_profile_instrument(const char *filename);
22
23 /**
24  * Reads the corresponding profile info file if it exists and returns a
25  * profile info struct
26  * @param filename The name of the file containing profile information
27  */
28 void be_profile_read(const char *filename);
29
30 /**
31  * Frees the profile info
32  */
33 void be_profile_free(void);
34
35 /**
36  * Get block execution count as determined be profiling
37  */
38 unsigned int be_profile_get_block_execcount(const ir_node * block);
39
40 /**
41  * Initializes exec_freq structure for an irg based on profile data
42  */
43 exec_freq_t *be_create_execfreqs_from_profile(ir_graph *irg);
44
45 /**
46  * Tells whether profile module has acquired data
47  */
48 int be_profile_has_data(void);
49
50 #endif /* _BEPROFILE_H_ */