summaryrefslogtreecommitdiff
path: root/tools/perf/config/feature-tests.mak
blob: 028fe997d5ebcfecce4d013fa43e9c21c7f989a2 (plain)
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
define SOURCE_HELLO
#include <stdio.h>
int main(void)
{
	return puts(\"hi\");
}
endef

ifndef NO_DWARF
define SOURCE_DWARF
#include <dwarf.h>
#include <elfutils/libdw.h>
#include <elfutils/version.h>
#ifndef _ELFUTILS_PREREQ
#error
#endif

int main(void)
{
	Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);
	return (long)dbg;
}
endef
endif

define SOURCE_LIBELF
#include <libelf.h>

int main(void)
{
	Elf *elf = elf_begin(0, ELF_C_READ, 0);
	return (long)elf;
}
endef

define SOURCE_GLIBC
#include <gnu/libc-version.h>

int main(void)
{
	const char *version = gnu_get_libc_version();
	return (long)version;
}
endef

define SOURCE_BIONIC
#include <android/api-level.h>

int main(void)
{
	return __ANDROID_API__;
}
endef

define SOURCE_ELF_MMAP
#include <libelf.h>
int main(void)
{
	Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0);
	return (long)elf;
}
endef

define SOURCE_ELF_GETPHDRNUM
#include <libelf.h>
int main(void)
{
	size_t dst;
	return elf_getphdrnum(0, &dst);
}
endef

ifndef NO_SLANG
define SOURCE_SLANG
#include <slang.h>

int main(void)
{
	return SLsmg_init_smg();
}
endef
endif

ifndef NO_GTK2
define SOURCE_GTK2
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
#include <gtk/gtk.h>
#pragma GCC diagnostic error \"-Wstrict-prototypes\"

int main(int argc, char *argv[])
{
        gtk_init(&argc, &argv);

        return 0;
}
endef

define SOURCE_GTK2_INFOBAR
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
#include <gtk/gtk.h>
#pragma GCC diagnostic error \"-Wstrict-prototypes\"

int main(void)
{
	gtk_info_bar_new();

	return 0;
}
endef
endif

ifndef NO_LIBPERL
define SOURCE_PERL_EMBED
#include <EXTERN.h>
#include <perl.h>

int main(void)
{
perl_alloc();
return 0;
}
endef
endif

ifndef NO_LIBPYTHON
define SOURCE_PYTHON_VERSION
#include <Python.h>
#if PY_VERSION_HEX >= 0x03000000
	#error
#endif
int main(void)
{
	return 0;
}
endef
define SOURCE_PYTHON_EMBED
#include <Python.h>
int main(void)
{
	Py_Initialize();
	return 0;
}
endef
endif

define SOURCE_BFD
#include <bfd.h>

int main(void)
{
	bfd_demangle(0, 0, 0);
	return 0;
}
endef

define SOURCE_CPLUS_DEMANGLE
extern char *cplus_demangle(const char *, int);

int main(void)
{
	cplus_demangle(0, 0);
	return 0;
}
endef

define SOURCE_STRLCPY
#include <stdlib.h>
extern size_t strlcpy(char *dest, const char *src, size_t size);

int main(void)
{
	strlcpy(NULL, NULL, 0);
	return 0;
}
endef

ifndef NO_LIBUNWIND
define SOURCE_LIBUNWIND
#include <libunwind.h>
#include <stdlib.h>

extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
                                      unw_word_t ip,
                                      unw_dyn_info_t *di,
                                      unw_proc_info_t *pi,
                                      int need_unwind_info, void *arg);

#define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table)

int main(void)
{
	unw_addr_space_t addr_space;
	addr_space = unw_create_addr_space(NULL, 0);
	unw_init_remote(NULL, addr_space, NULL);
	dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL);
	return 0;
}
endef

define SOURCE_LIBUNWIND_DEBUG_FRAME
#include <libunwind.h>
#include <stdlib.h>

extern int
UNW_OBJ(dwarf_find_debug_frame) (int found, unw_dyn_info_t *di_debug,
				 unw_word_t ip, unw_word_t segbase,
				 const char *obj_name, unw_word_t start,
				 unw_word_t end);

#define dwarf_find_debug_frame UNW_OBJ(dwarf_find_debug_frame)

int main(void)
{
	dwarf_find_debug_frame(0, NULL, 0, 0, NULL, 0, 0);
	return 0;
}
endef

endif

ifndef NO_BACKTRACE
define SOURCE_BACKTRACE
#include <execinfo.h>
#include <stdio.h>

int main(void)
{
	backtrace(NULL, 0);
	backtrace_symbols(NULL, 0);
	return 0;
}
endef
endif

ifndef NO_LIBAUDIT
define SOURCE_LIBAUDIT
#include <libaudit.h>

int main(void)
{
	printf(\"error message: %s\", audit_errno_to_name(0));
	return audit_open();
}
endef
endif

define SOURCE_ON_EXIT
#include <stdio.h>

int main(void)
{
	return on_exit(NULL, NULL);
}
endef

define SOURCE_LIBNUMA
#include <numa.h>
#include <numaif.h>

int main(void)
{
	numa_available();
	return 0;
}
endef