-
Notifications
You must be signed in to change notification settings - Fork 13
/
verrou.h
201 lines (169 loc) · 8.06 KB
/
verrou.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/*--------------------------------------------------------------------*/
/*--- Verrou: a FPU instrumentation tool. ---*/
/*--- Headers for the public API. ---*/
/*--- verrou.h ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Verrou, a FPU instrumentation tool.
Copyright (C) 2014-2021 EDF
F. Févotte <[email protected]>
B. Lathuilière <[email protected]>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __VERROU_H
#define __VERROU_H
#ifdef VERROU_SYNCHRO_INCLUDE
#include "../include/valgrind.h"
#else
#include "pub_tool_clreq.h"
#endif
/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
This enum comprises an ABI exported by Valgrind to programs
which use client requests. DO NOT CHANGE THE ORDER OF THESE
ENTRIES, NOR DELETE ANY -- add new ones at the end.
*/
typedef
enum {
VR_USERREQ__START_INSTRUMENTATION = VG_USERREQ_TOOL_BASE('V', 'R'),
VR_USERREQ__STOP_INSTRUMENTATION,
VR_USERREQ__START_DETERMINISTIC,
VR_USERREQ__STOP_DETERMINISTIC,
VR_USERREQ__DISPLAY_COUNTERS,
VR_USERREQ__DUMP_COVER,
VR_USERREQ__COUNT_FP_INSTRUMENTED,
VR_USERREQ__COUNT_FP_NOT_INSTRUMENTED,
VR_USERREQ__PRINT_PROFILING_EXACT,
VR_USERREQ__SET_SEED,
VR_USERREQ__PRANDOM_UPDATE,
VR_USERREQ__PRANDOM_UPDATE_VALUE,
VR_USERREQ__GET_ROUNDING,
VR_USERREQ__GET_LIBM_ROUNDING,
VR_USERREQ__NAN_DETECTED,
VR_USERREQ__INF_DETECTED,
VR_USERREQ__IS_INSTRUMENTED_FLOAT,
VR_USERREQ__IS_INSTRUMENTED_DOUBLE,
VR_USERREQ__IS_INSTRUMENTED_LDOUBLE,
VR_USERREQ__COUNT_OP,
VR_USERREQ__GENERATE_EXCLUDE_SOURCE,
VR_USERREQ__IS_INSTRUMENTED_EXCLUDE_SOURCE,
VR_USERREQ__REGISTER_CACHE,
VR_USERREQ__GET_SEED,
VR_USERREQ__REGISTER_CACHE_SEED,
VR_USERREQ__GET_LIBM_ROUNDING_NO_INST,
VR_USERREQ__START_SOFT_INSTRUMENTATION,
VR_USERREQ__STOP_SOFT_INSTRUMENTATION,
VR_USERREQ__FLOAT_CONV
} Vg_VerrouClientRequest;
#define VERROU_START_INSTRUMENTATION \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__START_INSTRUMENTATION, \
0, 0, 0, 0, 0)
#define VERROU_STOP_INSTRUMENTATION \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__STOP_INSTRUMENTATION, \
0, 0, 0, 0, 0)
#define VERROU_START_SOFT_INSTRUMENTATION \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__START_SOFT_INSTRUMENTATION, \
0, 0, 0, 0, 0)
#define VERROU_STOP_SOFT_INSTRUMENTATION \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__STOP_SOFT_INSTRUMENTATION, \
0, 0, 0, 0, 0)
#define VERROU_START_DETERMINISTIC(LEVEL) \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__START_DETERMINISTIC, \
LEVEL, 0, 0, 0, 0)
#define VERROU_STOP_DETERMINISTIC(LEVEL) \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__STOP_DETERMINISTIC, \
LEVEL, 0, 0, 0, 0)
#define VERROU_SET_SEED(SEED) \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__SET_SEED, \
SEED, 0, 0, 0, 0)
#define VERROU_DISPLAY_COUNTERS \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__DISPLAY_COUNTERS, \
0, 0, 0, 0, 0)
#define VERROU_PRINT_PROFILING_EXACT \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__PRINT_PROFILING_EXACT, \
0, 0, 0, 0, 0)
#define VERROU_DUMP_COVER \
(unsigned int)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__DUMP_COVER, \
0, 0, 0, 0, 0)
#define VERROU_COUNT_FP_INSTRUMENTED \
(unsigned int)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__COUNT_FP_INSTRUMENTED,\
0, 0, 0, 0, 0)
#define VERROU_COUNT_FP_NOT_INSTRUMENTED \
(unsigned int)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__COUNT_FP_NOT_INSTRUMENTED,\
0, 0, 0, 0, 0)
#define VERROU_PRANDOM_UPDATE \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__PRANDOM_UPDATE, \
0, 0, 0, 0, 0)
#define VERROU_PRANDOM_UPDATE_VALUE(P)\
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__PRANDOM_UPDATE_VALUE, \
P, 0, 0, 0, 0)
#define VERROU_GET_ROUNDING \
(vr_RoundingMode)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__GET_ROUNDING, \
0, 0, 0, 0, 0)
#define VERROU_GET_LIBM_ROUNDING \
(vr_RoundingMode)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__GET_LIBM_ROUNDING, \
0, 0, 0, 0, 0)
#define VERROU_GET_LIBM_ROUNDING_NO_INST \
(vr_RoundingMode)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__GET_LIBM_ROUNDING_NO_INST, \
0, 0, 0, 0, 0)
#define VERROU_NAN_DETECTED \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__NAN_DETECTED, \
0, 0, 0, 0, 0)
#define VERROU_INF_DETECTED \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__INF_DETECTED, \
0, 0, 0, 0, 0)
#define VERROU_IS_INSTRUMENTED_FLOAT \
(Bool)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__IS_INSTRUMENTED_FLOAT,\
0, 0, 0, 0, 0)
#define VERROU_IS_INSTRUMENTED_DOUBLE \
(Bool)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__IS_INSTRUMENTED_DOUBLE,\
0, 0, 0, 0, 0)
#define VERROU_IS_INSTRUMENTED_LDOUBLE \
(Bool)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__IS_INSTRUMENTED_LDOUBLE,\
0, 0, 0, 0, 0)
#define VERROU_COUNT_OP \
(Bool)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__COUNT_OP,\
0, 0, 0, 0, 0)
#define VERROU_GENERATE_EXCLUDE_SOURCE(FCTNAME, LINENUM, FILENAME, OBJECT) \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__GENERATE_EXCLUDE_SOURCE, \
FCTNAME, LINENUM, FILENAME, OBJECT, 0)
#define VERROU_IS_INSTRUMENTED_EXCLUDE_SOURCE(FCTNAME, LINENUM, FILENAME, OBJECT) \
(Bool)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__IS_INSTRUMENTED_EXCLUDE_SOURCE,\
FCTNAME, LINENUM, FILENAME, OBJECT, 0)
#define VERROU_REGISTER_CACHE(CACHEPTR, SIZE) \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__REGISTER_CACHE,\
CACHEPTR,SIZE, 0, 0, 0)
#define VERROU_GET_SEED \
(uint64_t) VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__GET_SEED,\
0, 0, 0, 0, 0)
#define VERROU_REGISTER_CACHE_SEED(CACHEPTR) \
VALGRIND_DO_CLIENT_REQUEST_STMT(VR_USERREQ__REGISTER_CACHE_SEED,\
CACHEPTR,0, 0, 0, 0)
#define VERROU_FLOAT_CONV \
(Bool)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */, \
VR_USERREQ__FLOAT_CONV, \
0, 0, 0, 0, 0)
#endif /* __VERROU_H */