]>
git.saurik.com Git - bison.git/blob - lib/timevar.h
1 /* Timing variables for measuring compiler performance.
2 Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
3 Contributed by Alex Samuel <samuel@codesourcery.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* Timing variables are used to measure elapsed time in various
22 portions of the compiler. Each measures elapsed user, system, and
23 wall-clock time, as appropriate to and supported by the host
26 Timing variables are defined using the DEFTIMEVAR macro in
27 timevar.def. Each has an enumeral identifier, used when referring
28 to the timing variable in code, and a character string name.
30 Timing variables can be used in two ways:
32 - On the timing stack, using timevar_push and timevar_pop.
33 Timing variables may be pushed onto the stack; elapsed time is
34 attributed to the topmost timing variable on the stack. When
35 another variable is pushed on, the previous topmost variable is
36 `paused' until the pushed variable is popped back off.
38 - As a standalone timer, using timevar_start and timevar_stop.
39 All time elapsed between the two calls is attributed to the
43 /* This structure stores the various varieties of time that can be
44 measured. Times are stored in seconds. The time may be an
45 absolute time or a time difference; in the former case, the time
46 base is undefined, except that the difference between two times
47 produces a valid time difference. */
49 struct timevar_time_def
51 /* User time in this process. */
54 /* System time (if applicable for this host platform) in this
58 /* Wall clock time. */
62 /* An enumeration of timing variable identifiers. Constructed from
63 the contents of timevar.def. */
65 #define DEFTIMEVAR(identifier__, name__) \
69 #include "timevar.def"
75 extern void init_timevar (void);
76 extern void timevar_push (timevar_id_t
);
77 extern void timevar_pop (timevar_id_t
);
78 extern void timevar_start (timevar_id_t
);
79 extern void timevar_stop (timevar_id_t
);
80 extern void timevar_get (timevar_id_t
, struct timevar_time_def
*);
81 extern void timevar_print (FILE *);
83 /* Provided for backward compatibility. */
84 extern long get_run_time (void);
85 extern void print_time (const char *, long);
87 extern int timevar_report
;
89 #endif /* ! GCC_TIMEVAR_H */