* src/vm/rt-timing.c: Added timing of linker stages.
[cacao.git] / src / vm / rt-timing.h
1 /* src/vm/rt-timing.h - POSIX real-time timing utilities
2
3    Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    Contact: cacao@cacaojvm.org
26
27    Authors: Edwin Steiner
28
29    Changes:
30
31    $Id$
32
33 */
34
35 #ifndef _RT_TIMING_H
36 #define _RT_TIMING_H
37
38 #if defined(ENABLE_RT_TIMING)
39
40 #include "config.h"
41 #include "vm/types.h"
42
43 #include <time.h>
44
45 #include "mm/memory.h"
46 #include "vm/global.h"
47
48 #define RT_TIMING_GET_TIME(ts) \
49         rt_timing_gettime(&(ts));
50
51 #define RT_TIMING_TIME_DIFF(a,b,index) \
52         rt_timing_time_diff(&(a),&(b),(index));
53
54 #define RT_TIMING_JIT_CHECKS     0
55 #define RT_TIMING_JIT_PARSE      1
56 #define RT_TIMING_JIT_STACK      2
57 #define RT_TIMING_JIT_TYPECHECK  3
58 #define RT_TIMING_JIT_LOOP       4
59 #define RT_TIMING_JIT_IFCONV     5
60 #define RT_TIMING_JIT_ALLOC      6
61 #define RT_TIMING_JIT_RPLPOINTS  7
62 #define RT_TIMING_JIT_CODEGEN    8
63 #define RT_TIMING_JIT_TOTAL      9
64
65 #define RT_TIMING_LINK_RESOLVE   10
66 #define RT_TIMING_LINK_C_VFTBL   11
67 #define RT_TIMING_LINK_ABSTRACT  12
68 #define RT_TIMING_LINK_C_IFTBL   13
69 #define RT_TIMING_LINK_F_VFTBL   14
70 #define RT_TIMING_LINK_OFFSETS   15
71 #define RT_TIMING_LINK_F_IFTBL   16
72 #define RT_TIMING_LINK_FINALIZER 17
73 #define RT_TIMING_LINK_EXCEPTS   18
74 #define RT_TIMING_LINK_SUBCLASS  19
75 #define RT_TIMING_LINK_TOTAL     20
76
77 #define RT_TIMING_N              21
78
79 void rt_timing_gettime(struct timespec *ts);
80
81 void rt_timing_time_diff(struct timespec *a,struct timespec *b,int index);
82
83 void rt_timing_print_time_stats(FILE *file);
84
85 #else /* !defined(ENABLE_RT_TIMING) */
86
87 #define RT_TIMING_GET_TIME(ts)
88 #define RT_TIMING_TIME_DIFF(a,b,index)
89
90 #endif /* defined(ENABLE_RT_TIMING) */
91
92 #endif /* _RT_TIMING_H */
93
94 /*
95  * These are local overrides for various environment variables in Emacs.
96  * Please do not remove this and leave it at the end of the file, where
97  * Emacs will automagically detect them.
98  * ---------------------------------------------------------------------
99  * Local variables:
100  * mode: c
101  * indent-tabs-mode: t
102  * c-basic-offset: 4
103  * tab-width: 4
104  * End:
105  * vim:noexpandtab:sw=4:ts=4:
106  */