Mercurial > hg > CbC > CbC_gcc
annotate gcc/timevar.h @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
rev | line source |
---|---|
0 | 1 /* Timing variables for measuring compiler performance. |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2 Copyright (C) 2000, 2003, 2004, 2005, 2007, 2009 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
3 Free Software Foundation, Inc. |
0 | 4 Contributed by Alex Samuel <samuel@codesourcery.com> |
5 | |
6 This file is part of GCC. | |
7 | |
8 GCC is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by | |
10 the Free Software Foundation; either version 3, or (at your option) | |
11 any later version. | |
12 | |
13 GCC is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | |
16 License for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with GCC; see the file COPYING3. If not see | |
20 <http://www.gnu.org/licenses/>. */ | |
21 | |
22 #ifndef GCC_TIMEVAR_H | |
23 #define GCC_TIMEVAR_H | |
24 | |
25 /* Timing variables are used to measure elapsed time in various | |
26 portions of the compiler. Each measures elapsed user, system, and | |
27 wall-clock time, as appropriate to and supported by the host | |
28 system. | |
29 | |
30 Timing variables are defined using the DEFTIMEVAR macro in | |
31 timevar.def. Each has an enumeral identifier, used when referring | |
32 to the timing variable in code, and a character string name. | |
33 | |
34 Timing variables can be used in two ways: | |
35 | |
36 - On the timing stack, using timevar_push and timevar_pop. | |
37 Timing variables may be pushed onto the stack; elapsed time is | |
38 attributed to the topmost timing variable on the stack. When | |
39 another variable is pushed on, the previous topmost variable is | |
40 `paused' until the pushed variable is popped back off. | |
41 | |
42 - As a standalone timer, using timevar_start and timevar_stop. | |
43 All time elapsed between the two calls is attributed to the | |
44 variable. | |
45 */ | |
46 | |
47 /* This structure stores the various varieties of time that can be | |
48 measured. Times are stored in seconds. The time may be an | |
49 absolute time or a time difference; in the former case, the time | |
50 base is undefined, except that the difference between two times | |
51 produces a valid time difference. */ | |
52 | |
53 struct timevar_time_def | |
54 { | |
55 /* User time in this process. */ | |
56 double user; | |
57 | |
58 /* System time (if applicable for this host platform) in this | |
59 process. */ | |
60 double sys; | |
61 | |
62 /* Wall clock time. */ | |
63 double wall; | |
64 | |
65 /* Garbage collector memory. */ | |
66 unsigned ggc_mem; | |
67 }; | |
68 | |
69 /* An enumeration of timing variable identifiers. Constructed from | |
70 the contents of timevar.def. */ | |
71 | |
72 #define DEFTIMEVAR(identifier__, name__) \ | |
73 identifier__, | |
74 typedef enum | |
75 { | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
76 TV_NONE, |
0 | 77 #include "timevar.def" |
78 TIMEVAR_LAST | |
79 } | |
80 timevar_id_t; | |
81 #undef DEFTIMEVAR | |
82 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
83 /* True if timevars should be used. In GCC, this happens with |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
84 the -ftime-report flag. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
85 extern bool timevar_enable; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
86 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
87 /* Total amount of memory allocated by garbage collector. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
88 extern size_t timevar_ggc_mem_total; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
89 |
0 | 90 /* Execute the sequence: timevar_pop (TV), return (E); */ |
91 #define POP_TIMEVAR_AND_RETURN(TV, E) do { timevar_pop (TV); return (E); }while(0) | |
92 | |
93 extern void timevar_init (void); | |
94 extern void timevar_push_1 (timevar_id_t); | |
95 extern void timevar_pop_1 (timevar_id_t); | |
96 extern void timevar_start (timevar_id_t); | |
97 extern void timevar_stop (timevar_id_t); | |
98 extern void timevar_print (FILE *); | |
99 | |
100 /* Provided for backward compatibility. */ | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
101 static inline void |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
102 timevar_push (timevar_id_t tv) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
103 { |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
104 if (timevar_enable) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
105 timevar_push_1 (tv); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
106 } |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
107 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
108 static inline void |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
109 timevar_pop (timevar_id_t tv) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
110 { |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
111 if (timevar_enable) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
112 timevar_pop_1 (tv); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
113 } |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
114 |
0 | 115 extern void print_time (const char *, long); |
116 | |
117 #endif /* ! GCC_TIMEVAR_H */ |