]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/timevar.h
target.h: Fix formatting.
[thirdparty/gcc.git] / gcc / timevar.h
CommitLineData
2a9a326b
AS
1/* Timing variables for measuring compiler performance.
2 Copyright (C) 2000 Free Software Foundation, Inc.
3 Contributed by Alex Samuel <samuel@codesourcery.com>
4
1322177d 5 This file is part of GCC.
2a9a326b 6
1322177d
LB
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
2a9a326b
AS
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
1322177d
LB
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
2a9a326b
AS
16
17 You should have received a copy of the GNU General Public License
1322177d
LB
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
2a9a326b 21
0e5921e8
ZW
22#ifndef GCC_TIMEVAR_H
23#define GCC_TIMEVAR_H
24
2a9a326b
AS
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
41077ce4 44 variable.
2a9a326b 45*/
41077ce4 46
2a9a326b 47/* This structure stores the various varieties of time that can be
20cc76d5 48 measured. Times are stored in seconds. The time may be an
2a9a326b
AS
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
53struct timevar_time_def
54{
55 /* User time in this process. */
20cc76d5 56 float user;
2a9a326b
AS
57
58 /* System time (if applicable for this host platform) in this
59 process. */
20cc76d5 60 float sys;
2a9a326b
AS
61
62 /* Wall clock time. */
20cc76d5 63 float wall;
2a9a326b
AS
64};
65
684d9f3b 66/* An enumeration of timing variable identifiers. Constructed from
2a9a326b
AS
67 the contents of timevar.def. */
68
69#define DEFTIMEVAR(identifier__, name__) \
41077ce4 70 identifier__,
2a9a326b
AS
71typedef enum
72{
73#include "timevar.def"
74 TIMEVAR_LAST
75}
76timevar_id_t;
77#undef DEFTIMEVAR
78
79extern void init_timevar PARAMS ((void));
80extern void timevar_push PARAMS ((timevar_id_t));
81extern void timevar_pop PARAMS ((timevar_id_t));
82extern void timevar_start PARAMS ((timevar_id_t));
83extern void timevar_stop PARAMS ((timevar_id_t));
84extern void timevar_get PARAMS ((timevar_id_t, struct timevar_time_def *));
85extern void timevar_print PARAMS ((FILE *));
86
87/* Provided for backward compatibility. */
88extern long get_run_time PARAMS ((void));
89extern void print_time PARAMS ((const char *, long));
0e5921e8 90
88657302 91#endif /* ! GCC_TIMEVAR_H */