blob: 680654a0de5cdcb298ad2ab6e98a5803d869ab86 [file] [log] [blame]
Philipp Schrader9b1790e2018-03-10 20:21:30 -08001licenses(["notice"])
Brian Silverman660d6092015-11-26 18:41:59 -05002
Austin Schuhdde64052019-12-11 20:28:00 -08003load("//tools/build_rules:select.bzl", "compiler_select", "cpu_select")
Philipp Schrader9b1790e2018-03-10 20:21:30 -08004load("//tools/build_rules:empty_main.bzl", "empty_main_if_asan")
Brian Silverman660d6092015-11-26 18:41:59 -05005
6common_copts = [
Brian Silvermana659aaa2022-01-02 00:19:11 -08007 # Stuff from their Makefile.
Philipp Schrader9b1790e2018-03-10 20:21:30 -08008 "-Wno-cast-align",
9 "-Wno-sign-compare",
10 "-fno-builtin-malloc",
11 "-fno-builtin-free",
12 "-fno-builtin-realloc",
13 "-fno-builtin-calloc",
14 "-fno-builtin-cfree",
15 "-fno-builtin-memalign",
16 "-fno-builtin-posix_memalign",
17 "-fno-builtin-valloc",
18 "-fno-builtin-pvalloc",
19 "-Wno-unused-result",
20 "-fno-omit-frame-pointer",
21 "-DNDEBUG",
Brian Silvermana659aaa2022-01-02 00:19:11 -080022 "-DENABLE_EMERGENCY_MALLOC",
Brian Silverman660d6092015-11-26 18:41:59 -050023
Brian Silvermana659aaa2022-01-02 00:19:11 -080024 # Stuff to make it work for us.
Philipp Schrader9b1790e2018-03-10 20:21:30 -080025 "-Ithird_party/gperftools/src/",
26 "-Ithird_party/empty_config_h",
27 "-Wno-unused-parameter",
28 "-Wno-missing-field-initializers",
29 "-Wno-unused-function",
30 "-Wno-unused-variable",
31 "-Wno-format-nonliteral",
32 "-Wno-switch-enum",
33 "-Wno-error=cast-align",
34 "-Wno-error=cast-qual",
Tyler Chatowb8304af2022-02-25 20:52:46 -080035 "-Wno-cast-qual",
James Kuszmaul9776b392023-01-14 14:08:08 -080036 "-Wno-array-bounds",
37 "-Wno-cast-function-type",
Brian Silverman660d6092015-11-26 18:41:59 -050038
Brian Silvermana659aaa2022-01-02 00:19:11 -080039 # //build_tests:tcmalloc_build_test relies on this.
40 "-DENABLE_LARGE_ALLOC_REPORT=1",
41
42 # Stuff pulled out of config.h.
43 "-DGPERFTOOLS_CONFIG_H_=1",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080044 "-DHAVE_BUILTIN_EXPECT=1",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080045 "-DHAVE_DECL_MEMALIGN=1",
46 "-DHAVE_DECL_POSIX_MEMALIGN=1",
47 "-DHAVE_DECL_PVALLOC=1",
48 "-DHAVE_DECL_UNAME=1",
49 "-DHAVE_DECL_VALLOC=1",
50 "-DHAVE_DLFCN_H=1",
51 "-DHAVE_ELF32_VERSYM=1",
52 "-DHAVE_EXECINFO_H=1",
53 "-DHAVE_FCNTL_H=1",
54 "-DHAVE_FEATURES_H=1",
55 "-DHAVE_FORK=1",
56 "-DHAVE_GETEUID=1",
57 "-DHAVE_GLOB_H=1",
58 "-DHAVE_GRP_H=1",
59 "-DHAVE_INTTYPES_H=1",
60 "-DHAVE_LINUX_PTRACE_H=1",
61 "-DHAVE_LINUX_SIGEV_THREAD_ID=1",
62 "-DHAVE_MALLOC_H=1",
63 "-DHAVE_MEMORY_H=1",
64 "-DHAVE_MMAP=1",
65 "-DHAVE_NAMESPACES=1",
66 "-DHAVE_POLL_H=1",
67 "-DHAVE_PROGRAM_INVOCATION_NAME=1",
68 "-DHAVE_PTHREAD=1",
69 "-DHAVE_PWD_H=1",
70 "-DHAVE_SBRK=1",
71 "-DHAVE_SCHED_H=1",
72 "-DHAVE_STDINT_H=1",
73 "-DHAVE_STDLIB_H=1",
74 "-DHAVE_STRINGS_H=1",
75 "-DHAVE_STRING_H=1",
76 "-DHAVE_STRUCT_MALLINFO=1",
77 "-DHAVE_SYS_CDEFS_H=1",
78 "-DHAVE_SYS_PRCTL_H=1",
79 "-DHAVE_SYS_RESOURCE_H=1",
80 "-DHAVE_SYS_SOCKET_H=1",
81 "-DHAVE_SYS_STAT_H=1",
82 "-DHAVE_SYS_SYSCALL_H=1",
83 "-DHAVE_SYS_TYPES_H=1",
84 "-DHAVE_SYS_UCONTEXT_H=1",
85 "-DHAVE_SYS_WAIT_H=1",
86 "-DHAVE_TLS=1",
87 "-DHAVE_UCONTEXT_H=1",
88 "-DHAVE_UNISTD_H=1",
89 "-DHAVE_UNWIND_H=1",
90 "-DHAVE___ATTRIBUTE__=1",
91 "-DHAVE___ENVIRON=1",
92 "-DMALLOC_HOOK_MAYBE_VOLATILE=volatile",
93 "-DPERFTOOLS_DLL_DECL=",
94 "-DSTDC_HEADERS=1",
95 "-DSTL_NAMESPACE=std",
Brian Silvermana659aaa2022-01-02 00:19:11 -080096 "-DPACKAGE_STRING=\\\"gperftools\\ 2.9.1\\\"",
Austin Schuha5778ae2020-10-21 21:15:35 -070097 "-DPACKAGE_BUGREPORT=\\\"https://frc971.org/contact\\\"",
Brian Silvermana659aaa2022-01-02 00:19:11 -080098 "-DPACKAGE_VERSION=\\\"2.9.1\\\"",
Brian Silverman660d6092015-11-26 18:41:59 -050099] + cpu_select({
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800100 "amd64": [
101 "-DHAVE_GETPAGESZE=1",
102 "-DHAVE_SYS_PARAM_H=1",
103 "-DPC_FROM_UCONTEXT=uc_mcontext.gregs[REG_RIP]",
104 "-DPRIdS=\\\"ld\\\"",
105 "-DPRIuS=\\\"lu\\\"",
106 "-DPRIxS=\\\"lx\\\"",
107 ],
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800108 "arm32": [
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800109 "-DPC_FROM_UCONTEXT=uc_mcontext.arm_pc",
110 "-DPRIdS=\\\"d\\\"",
111 "-DPRIuS=\\\"u\\\"",
112 "-DPRIxS=\\\"x\\\"",
113 ],
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800114 "arm64": [
115 "-DPC_FROM_UCONTEXT=uc_mcontext.pc",
116 "-DPRIdS=\\\"ld\\\"",
117 "-DPRIuS=\\\"lu\\\"",
118 "-DPRIxS=\\\"lx\\\"",
119 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500120}) + compiler_select({
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800121 "clang": [
122 "-Wno-unused-const-variable",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800123 "-Wno-unused-but-set-variable",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800124 "-Wno-gnu-alignof-expression",
125 "-Wno-unused-private-field",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800126
127 # It has annotations for this analysis, but the invariants are too tricky
128 # for clang to figure out by itself so it has lots of false positives. Just
129 # disable the analysis to simplify.
130 "-Wno-thread-safety-analysis",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800131 ],
James Kuszmaul9776b392023-01-14 14:08:08 -0800132 "gcc": [
133 "-Wno-use-after-free",
134 "-Wno-ignored-qualifiers",
135 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500136})
137
138cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800139 name = "tcmalloc",
140 srcs = glob(
141 include = [
142 "src/*.cc",
143 "src/*.c",
144 "src/base/*.cc",
145 "src/base/*.c",
146 ],
147 exclude = [
148 "**/*_unittest.cc",
149 "**/*_test.cc",
150 "src/debugallocation.cc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800151 "src/fake_stacktrace_scope.cc",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800152 ],
153 ),
154 hdrs = glob([
155 "src/*.h",
156 "src/base/*.h",
157 "src/gperftools/*.h",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800158 ]),
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800159 copts = common_copts,
Austin Schuhdde64052019-12-11 20:28:00 -0800160 includes = ["src"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800161 linkopts = [
162 "-lrt",
163 "-lpthread",
164 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800165 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800166 visibility = ["//visibility:public"],
167 deps = [
168 "//third_party/empty_config_h",
169 ],
170 alwayslink = True,
Brian Silverman660d6092015-11-26 18:41:59 -0500171)
172
173cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800174 name = "testutil",
175 srcs = [
176 "src/tests/testutil.cc",
Brian Silverman660d6092015-11-26 18:41:59 -0500177 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800178 hdrs = [
179 "src/tests/testutil.h",
180 ],
181 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800182 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800183 deps = [
184 ":tcmalloc",
185 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500186)
187
188cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800189 name = "low_level_alloc_unittest",
190 size = "medium",
191 srcs = [
192 "src/tests/low_level_alloc_unittest.cc",
193 ],
194 copts = common_copts,
195 defines = [
196 "NO_TCMALLOC_SAMPLES",
197 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800198 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800199 deps = [
200 ":tcmalloc",
201 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500202)
203
204cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800205 name = "atomicops_unittest",
206 size = "small",
207 srcs = [
208 "src/tests/atomicops_unittest.cc",
209 ],
210 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800211 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800212 deps = [
213 ":tcmalloc",
214 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500215)
216
217cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800218 name = "stacktrace_unittest",
219 size = "small",
220 srcs = [
221 "src/tests/stacktrace_unittest.cc",
222 ],
223 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800224 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800225 deps = [
226 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800227 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800228 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500229)
230
231cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800232 name = "tcmalloc_unittest",
233 size = "small",
234 srcs = empty_main_if_asan([
235 "src/tests/tcmalloc_unittest.cc",
236 ]),
237 copts = common_copts + [
238 "-fno-builtin",
Austin Schuhdde64052019-12-11 20:28:00 -0800239 #Add this back in when we upgrade clang.
240 #'-Wno-mismatched-new-delete',
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800241 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800242 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800243 deps = [
244 ":tcmalloc",
245 ":testutil",
246 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500247)
248
249cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800250 name = "tcmalloc_large_unittest",
251 size = "small",
252 srcs = empty_main_if_asan([
253 "src/tests/tcmalloc_large_unittest.cc",
254 ]),
255 copts = common_copts + [
256 "-fno-builtin",
257 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800258 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800259 deps = [
260 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800261 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800262 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500263)
264
265cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800266 name = "addressmap_unittest",
267 size = "medium",
268 srcs = [
269 "src/tests/addressmap_unittest.cc",
270 ],
271 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800272 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800273 deps = [
274 ":tcmalloc",
275 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500276)
277
278cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800279 name = "system_alloc_unittest",
280 size = "small",
281 srcs = empty_main_if_asan([
282 "src/tests/system-alloc_unittest.cc",
283 ]),
284 copts = common_copts + [
285 "-fno-builtin",
286 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800287 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800288 deps = [
289 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800290 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800291 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500292)
293
294cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800295 name = "packed_cache_test",
296 size = "small",
297 srcs = [
298 "src/tests/packed-cache_test.cc",
299 ],
300 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800301 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800302 deps = [
303 ":tcmalloc",
304 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500305)
306
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800307cc_test(
308 name = "frag_unittest",
309 size = "small",
310 srcs = [
311 "src/tests/frag_unittest.cc",
312 ],
313 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800314 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800315 deps = [
316 ":tcmalloc",
317 ],
318)
319
320cc_test(
321 name = "markidle_unittest",
322 size = "small",
323 srcs = empty_main_if_asan([
324 "src/tests/markidle_unittest.cc",
325 ]),
326 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800327 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800328 deps = [
329 ":tcmalloc",
330 ":testutil",
331 ],
332)
333
334cc_test(
335 name = "current_allocated_bytes_test",
336 size = "small",
337 srcs = [
338 "src/tests/current_allocated_bytes_test.cc",
339 ],
340 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800341 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800342 deps = [
343 ":tcmalloc",
344 ],
345)
346
347cc_test(
348 name = "malloc_hook_test",
349 size = "small",
350 srcs = [
351 "src/tests/malloc_hook_test.cc",
352 ],
353 copts = common_copts + compiler_select({
354 "gcc": [
355 "-Wno-maybe-uninitialized",
356 ],
357 "clang": [],
358 }),
Philipp Schraderdada1072020-11-24 11:34:46 -0800359 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800360 deps = [
361 ":tcmalloc",
362 ":testutil",
363 ],
364)
365
366cc_test(
367 name = "malloc_extension_test",
368 size = "small",
369 srcs = empty_main_if_asan([
370 "src/tests/malloc_extension_test.cc",
371 ]),
372 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800373 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800374 deps = [
375 ":tcmalloc",
376 ],
377)
378
379cc_test(
380 name = "malloc_extension_c_test",
381 size = "small",
382 srcs = empty_main_if_asan([
383 "src/tests/malloc_extension_c_test.c",
384 ]),
385 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800386 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800387 deps = [
388 ":tcmalloc",
389 ],
390)
391
392cc_test(
393 name = "memalign_unittest",
394 size = "small",
395 srcs = empty_main_if_asan([
396 "src/tests/memalign_unittest.cc",
397 ]),
398 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800399 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800400 deps = [
401 ":tcmalloc",
402 ":testutil",
403 ],
404)
405
406cc_test(
407 name = "page_heap_test",
408 size = "small",
409 srcs = [
410 "src/tests/page_heap_test.cc",
411 ],
412 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800413 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800414 deps = [
415 ":tcmalloc",
416 ],
417)
418
419cc_test(
420 name = "pagemap_unittest",
421 size = "small",
422 srcs = empty_main_if_asan([
423 "src/tests/pagemap_unittest.cc",
424 ]),
425 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800426 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800427 deps = [
428 ":tcmalloc",
429 ],
430)
431
432cc_test(
433 name = "realloc_unittest",
434 size = "small",
435 srcs = [
436 "src/tests/realloc_unittest.cc",
437 ],
438 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800439 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800440 deps = [
441 ":tcmalloc",
442 ],
443)
444
445cc_test(
446 name = "stack_trace_table_test",
447 size = "small",
448 srcs = [
449 "src/tests/stack_trace_table_test.cc",
450 ],
451 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800452 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800453 deps = [
454 ":tcmalloc",
455 ],
456)
457
458cc_test(
459 name = "thread_dealloc_unittest",
460 size = "small",
461 srcs = [
462 "src/tests/thread_dealloc_unittest.cc",
463 ],
464 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800465 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800466 deps = [
467 ":tcmalloc",
468 ":testutil",
469 ],
470)
471
472"""
Brian Silverman660d6092015-11-26 18:41:59 -0500473We don't build this because it actually needs to be in a separate binary.
474cc_test(
475 name = 'debugallocation_test',
476 srcs = [
477 'src/tests/debugallocation_test.cc',
478 ],
479 deps = [
480 ':tcmalloc',
481 ],
482 copts = common_copts,
483 size = 'small',
484)
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800485"""
Brian Silverman660d6092015-11-26 18:41:59 -0500486
487cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800488 name = "tcmalloc_large_heap_fragmentation_unittest",
489 size = "small",
490 srcs = empty_main_if_asan([
491 "src/tests/large_heap_fragmentation_unittest.cc",
492 ]),
493 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800494 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800495 deps = [
496 ":tcmalloc",
497 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500498)
499
500cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800501 name = "raw_printer_test",
502 size = "small",
503 srcs = [
504 "src/tests/raw_printer_test.cc",
505 ],
506 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800507 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800508 deps = [
509 ":tcmalloc",
510 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500511)
512
513cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800514 name = "getpc_test",
515 size = "small",
516 srcs = empty_main_if_asan([
517 "src/tests/getpc_test.cc",
518 ]),
519 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800520 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800521 deps = [
522 ":tcmalloc",
523 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500524)
525
526cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800527 name = "profiledata_unittest",
528 size = "small",
529 srcs = [
530 "src/tests/profiledata_unittest.cc",
531 ],
532 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800533 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800534 deps = [
535 ":tcmalloc",
536 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500537)
538
539cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800540 name = "profile_handler_unittest",
541 size = "small",
542 srcs = [
543 "src/tests/profile-handler_unittest.cc",
544 ],
545 copts = common_copts,
546 flaky = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800547 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800548 deps = [
549 ":tcmalloc",
550 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500551)
552
553cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800554 name = "heap_profiler_unittest",
555 size = "small",
556 srcs = [
557 "src/tests/heap-profiler_unittest.cc",
558 ],
559 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800560 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800561 deps = [
562 ":tcmalloc",
563 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500564)
565
566cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800567 name = "sampler_test",
568 size = "small",
569 srcs = [
570 "src/tests/sampler_test.cc",
571 ],
572 copts = common_copts + [
573 "-Wno-type-limits",
574 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800575 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800576 deps = [
577 ":tcmalloc",
578 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500579)