Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2018 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | cc_defaults { |
| 18 | name: "simpleperf_defaults", |
| 19 | |
| 20 | cflags: [ |
| 21 | "-Wall", |
| 22 | "-Wextra", |
| 23 | "-Werror", |
George Burgess IV | da07844 | 2018-08-13 22:41:12 -0700 | [diff] [blame] | 24 | "-Wimplicit-fallthrough", |
Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 25 | |
| 26 | // Try some more extreme warnings. |
| 27 | "-Wpedantic", |
| 28 | "-Wunreachable-code-aggressive", |
| 29 | // And disable some dumb things. |
| 30 | "-Wno-zero-length-array", |
| 31 | "-Wno-c99-extensions", |
| 32 | "-Wno-language-extension-token", |
| 33 | "-Wno-gnu-zero-variadic-macro-arguments", |
| 34 | "-Wno-nested-anon-types", |
| 35 | "-Wno-gnu-statement-expression", |
| 36 | "-Wno-vla-extension", |
Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 37 | ], |
| 38 | cppflags: [ |
| 39 | "-Wno-sign-compare", |
| 40 | "-Wno-unused-parameter", |
| 41 | ], |
| 42 | } |
| 43 | |
Andreas Gampe | b017270 | 2018-09-17 13:33:02 -0700 | [diff] [blame] | 44 | cc_defaults { |
| 45 | name: "libsimpleperf_elf_read_static_reqs_defaults", |
| 46 | static_libs: [ |
| 47 | "libLLVMObject", |
| 48 | "libLLVMBitReader", |
| 49 | "libLLVMMC", |
| 50 | "libLLVMMCParser", |
| 51 | "libLLVMCore", |
| 52 | "libLLVMSupport", |
| 53 | "liblzma", |
| 54 | "libz", |
| 55 | "libziparchive", |
| 56 | ], |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 57 | target: { |
| 58 | // Required for LLVM. |
Yabin Cui | 17eff8d | 2019-01-31 11:52:19 -0800 | [diff] [blame] | 59 | darwin: { |
| 60 | host_ldlibs: [ |
| 61 | "-lncurses", |
| 62 | ], |
| 63 | }, |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 64 | linux_glibc: { |
| 65 | host_ldlibs: [ |
| 66 | "-lncurses", |
| 67 | ], |
| 68 | }, |
| 69 | }, |
Andreas Gampe | b017270 | 2018-09-17 13:33:02 -0700 | [diff] [blame] | 70 | } |
| 71 | |
Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 72 | cc_library_static { |
| 73 | name: "libsimpleperf_elf_read", |
| 74 | defaults: [ |
| 75 | "simpleperf_defaults", |
Andreas Gampe | b017270 | 2018-09-17 13:33:02 -0700 | [diff] [blame] | 76 | "libsimpleperf_elf_read_static_reqs_defaults", |
Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 77 | ], |
Andreas Gampe | 98d04ad | 2018-03-08 13:49:27 -0800 | [diff] [blame] | 78 | host_supported: true, |
Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 79 | |
| 80 | export_include_dirs: [ |
| 81 | ".", |
| 82 | ], |
| 83 | |
Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 84 | static_libs: [ |
| 85 | "libbase", |
| 86 | ], |
Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 87 | |
Yabin Cui | e1deac5 | 2018-01-23 15:04:44 -0800 | [diff] [blame] | 88 | srcs: [ |
| 89 | "read_apk.cpp", |
| 90 | "read_elf.cpp", |
| 91 | "utils.cpp", |
| 92 | ], |
| 93 | |
| 94 | group_static_libs: true, |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 95 | use_version_lib: true, |
Andreas Gampe | 98d04ad | 2018-03-08 13:49:27 -0800 | [diff] [blame] | 96 | } |
Andreas Gampe | a3b752c | 2018-09-18 19:25:24 -0700 | [diff] [blame] | 97 | |
| 98 | cc_defaults { |
| 99 | name: "libsimpleperf_dex_read_static_reqs_defaults", |
| 100 | defaults: ["libdexfile_static_defaults"], |
Martin Stjernholm | 7c27cc2 | 2018-11-28 00:46:00 +0000 | [diff] [blame] | 101 | static_libs: [ |
Martin Stjernholm | 401e6d9 | 2019-02-20 16:58:42 +0000 | [diff] [blame] | 102 | "libdexfile_support_static", |
Martin Stjernholm | 7c27cc2 | 2018-11-28 00:46:00 +0000 | [diff] [blame] | 103 | ], |
| 104 | header_libs: ["libdexfile_external_headers"], |
| 105 | export_header_lib_headers: ["libdexfile_external_headers"], |
Andreas Gampe | a3b752c | 2018-09-18 19:25:24 -0700 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | cc_library_static { |
| 109 | name: "libsimpleperf_dex_read", |
| 110 | defaults: [ |
| 111 | "simpleperf_defaults", |
| 112 | "libsimpleperf_dex_read_static_reqs_defaults", |
| 113 | ], |
| 114 | host_supported: true, |
| 115 | |
| 116 | export_include_dirs: [ |
| 117 | ".", |
| 118 | ], |
| 119 | |
Andreas Gampe | a3b752c | 2018-09-18 19:25:24 -0700 | [diff] [blame] | 120 | static_libs: ["libbase"], |
| 121 | |
| 122 | srcs: [ |
| 123 | "read_dex_file.cpp", |
| 124 | ], |
| 125 | |
| 126 | group_static_libs: true, |
| 127 | } |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 128 | |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 129 | cc_defaults { |
| 130 | name: "simpleperf_cflags", |
| 131 | target: { |
| 132 | host: { |
| 133 | cflags: [ |
| 134 | "-DUSE_BIONIC_UAPI_HEADERS", |
| 135 | "-fvisibility=hidden" |
| 136 | ], |
| 137 | include_dirs: ["bionic/libc/kernel"], |
| 138 | }, |
| 139 | darwin: { |
| 140 | cflags: ["-DNO_LIBDEXFILE_SUPPORT"], |
| 141 | local_include_dirs: ["nonlinux_support/include"], |
| 142 | }, |
| 143 | windows: { |
| 144 | cflags: ["-DNO_LIBDEXFILE_SUPPORT"], |
| 145 | local_include_dirs: ["nonlinux_support/include"], |
| 146 | } |
| 147 | }, |
| 148 | } |
| 149 | |
| 150 | cc_defaults { |
| 151 | name: "simpleperf_static_libs", |
| 152 | defaults: [ |
| 153 | "libsimpleperf_elf_read_static_reqs_defaults", |
| 154 | "simpleperf_cflags", |
| 155 | ], |
| 156 | host_supported: true, |
| 157 | static_libs: [ |
| 158 | "libbase", |
| 159 | "liblog", |
| 160 | "libutils", |
| 161 | "libprotobuf-cpp-lite", |
| 162 | ], |
| 163 | target: { |
| 164 | linux: { |
| 165 | static_libs: [ |
| 166 | "libunwindstack", |
Martin Stjernholm | 401e6d9 | 2019-02-20 16:58:42 +0000 | [diff] [blame] | 167 | "libdexfile_support_static", |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 168 | "libcutils", |
| 169 | "libprocinfo", |
| 170 | "libevent", |
| 171 | ], |
| 172 | }, |
| 173 | android: { |
| 174 | static_libs: [ |
| 175 | "libc", |
| 176 | ], |
| 177 | }, |
| 178 | host: { |
| 179 | stl: "libc++_static", |
| 180 | }, |
| 181 | windows: { |
| 182 | enabled: true, |
| 183 | }, |
| 184 | }, |
| 185 | use_version_lib: true, |
| 186 | } |
| 187 | |
| 188 | cc_defaults { |
| 189 | name: "simpleperf_shared_libs", |
| 190 | defaults: [ |
| 191 | "simpleperf_cflags", |
| 192 | ], |
| 193 | host_supported: true, |
| 194 | shared_libs: [ |
| 195 | "libbase", |
| 196 | "liblzma", |
| 197 | "libprotobuf-cpp-lite", |
| 198 | "libziparchive", |
| 199 | ], |
| 200 | target: { |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 201 | linux: { |
| 202 | shared_libs: [ |
| 203 | "libcutils", |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 204 | "libdexfile_support", |
| 205 | "libevent", |
| 206 | "libprocinfo", |
| 207 | "libunwindstack", |
| 208 | ], |
| 209 | }, |
Yabin Cui | 17eff8d | 2019-01-31 11:52:19 -0800 | [diff] [blame] | 210 | darwin: { |
| 211 | host_ldlibs: [ |
| 212 | "-lncurses", |
| 213 | ], |
| 214 | }, |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 215 | linux_glibc: { |
| 216 | host_ldlibs: [ |
| 217 | "-lncurses", |
| 218 | ], |
| 219 | }, |
| 220 | host: { |
| 221 | static_libs: [ |
| 222 | "libLLVMObject", |
| 223 | "libLLVMBitReader", |
| 224 | "libLLVMMC", |
| 225 | "libLLVMMCParser", |
| 226 | "libLLVMCore", |
| 227 | "libLLVMSupport", |
| 228 | ], |
| 229 | }, |
| 230 | windows: { |
| 231 | enabled: true, |
| 232 | }, |
| 233 | }, |
| 234 | use_version_lib: true, |
| 235 | } |
| 236 | |
| 237 | cc_defaults { |
Yabin Cui | bcbffab | 2019-02-27 10:53:16 -0800 | [diff] [blame] | 238 | name: "simpleperf_libs_for_tests", |
| 239 | defaults: ["simpleperf_shared_libs"], |
| 240 | target: { |
| 241 | android: { |
| 242 | // 32-bit libLLVM_android isn't shipped on device. So use static llvm libs in tests. |
| 243 | static_libs: [ |
| 244 | "libLLVMObject", |
| 245 | "libLLVMBitReader", |
| 246 | "libLLVMMC", |
| 247 | "libLLVMMCParser", |
| 248 | "libLLVMCore", |
| 249 | "libLLVMSupport", |
| 250 | ], |
| 251 | }, |
| 252 | }, |
| 253 | } |
| 254 | |
| 255 | cc_defaults { |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 256 | name: "libsimpleperf_srcs", |
| 257 | srcs: [ |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 258 | "cmd_dumprecord.cpp", |
| 259 | "cmd_help.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 260 | "cmd_kmem.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 261 | "cmd_report.cpp", |
| 262 | "cmd_report_sample.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 263 | "command.cpp", |
| 264 | "dso.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 265 | "event_attr.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 266 | "event_type.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 267 | "perf_regs.cpp", |
| 268 | "read_apk.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 269 | "read_elf.cpp", |
| 270 | "record.cpp", |
| 271 | "record_file_reader.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 272 | "report_sample.proto", |
| 273 | "thread_tree.cpp", |
| 274 | "tracing.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 275 | "utils.cpp", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 276 | ], |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 277 | target: { |
| 278 | linux: { |
| 279 | srcs: [ |
| 280 | "CallChainJoiner.cpp", |
Yabin Cui | 1befe4f | 2019-02-25 15:22:43 -0800 | [diff] [blame] | 281 | "cmd_api.cpp", |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 282 | "cmd_debug_unwind.cpp", |
| 283 | "cmd_list.cpp", |
| 284 | "cmd_record.cpp", |
| 285 | "cmd_stat.cpp", |
| 286 | "cmd_trace_sched.cpp", |
| 287 | "environment.cpp", |
| 288 | "event_fd.cpp", |
| 289 | "event_selection_set.cpp", |
| 290 | "InplaceSamplerClient.cpp", |
| 291 | "IOEventLoop.cpp", |
| 292 | "JITDebugReader.cpp", |
| 293 | "OfflineUnwinder.cpp", |
| 294 | "read_dex_file.cpp", |
| 295 | "record_file_writer.cpp", |
| 296 | "RecordReadThread.cpp", |
| 297 | "UnixSocket.cpp", |
| 298 | "workload.cpp", |
| 299 | ], |
| 300 | }, |
| 301 | darwin: { |
| 302 | srcs: ["nonlinux_support/nonlinux_support.cpp"], |
| 303 | }, |
| 304 | windows: { |
| 305 | srcs: ["nonlinux_support/nonlinux_support.cpp"], |
| 306 | }, |
| 307 | }, |
| 308 | } |
| 309 | |
| 310 | cc_library_static { |
| 311 | name: "libsimpleperf", |
| 312 | defaults: [ |
| 313 | "libsimpleperf_srcs", |
| 314 | "simpleperf_static_libs", |
Yabin Cui | 4192f46 | 2019-01-17 15:10:51 -0800 | [diff] [blame] | 315 | ], |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 316 | compile_multilib: "both", |
| 317 | proto: { |
| 318 | type: "lite", |
| 319 | }, |
| 320 | static_libs: [ |
| 321 | "libbuildversion", |
| 322 | ], |
| 323 | use_version_lib: false, |
| 324 | } |
| 325 | |
| 326 | // simpleperf shipped in system image |
| 327 | cc_binary { |
| 328 | name: "simpleperf", |
| 329 | defaults: [ |
| 330 | "simpleperf_shared_libs", |
| 331 | ], |
| 332 | host_supported: false, |
| 333 | srcs: [ |
| 334 | "main.cpp", |
| 335 | ], |
| 336 | static_libs: ["libsimpleperf"], |
Yabin Cui | bcbffab | 2019-02-27 10:53:16 -0800 | [diff] [blame] | 337 | target: { |
| 338 | android: { |
| 339 | shared_libs: [ |
| 340 | "libLLVM_android", |
| 341 | ], |
| 342 | }, |
| 343 | }, |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | // simpleperf released in ndk |
| 347 | cc_binary { |
| 348 | name: "simpleperf_ndk", |
| 349 | defaults: [ |
| 350 | "simpleperf_static_libs", |
| 351 | ], |
| 352 | dist: { |
Elliott Hughes | d435d36 | 2019-04-02 13:00:55 -0700 | [diff] [blame] | 353 | targets: ["sdk", "win_sdk", "simpleperf"], |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 354 | }, |
| 355 | srcs: [ |
| 356 | "main.cpp", |
| 357 | ], |
| 358 | static_libs: [ |
| 359 | "libsimpleperf", |
| 360 | ], |
| 361 | |
| 362 | compile_multilib: "both", |
| 363 | multilib: { |
| 364 | lib64: { |
| 365 | suffix: "64", |
| 366 | }, |
| 367 | }, |
| 368 | |
| 369 | target: { |
| 370 | android: { |
| 371 | static_executable: true, |
| 372 | }, |
| 373 | android_arm: { |
| 374 | dist: { |
| 375 | dir: "simpleperf/android/arm", |
| 376 | }, |
| 377 | }, |
| 378 | android_arm64: { |
| 379 | dist: { |
| 380 | dir: "simpleperf/android/arm64", |
| 381 | }, |
| 382 | }, |
| 383 | android_x86: { |
| 384 | dist: { |
| 385 | dir: "simpleperf/android/x86", |
| 386 | }, |
| 387 | }, |
| 388 | android_x86_64: { |
| 389 | dist: { |
| 390 | dir: "simpleperf/android/x86_64", |
| 391 | }, |
| 392 | }, |
| 393 | darwin: { |
| 394 | dist: { |
| 395 | dir: "simpleperf/darwin/x86", |
| 396 | }, |
| 397 | }, |
| 398 | darwin_x86_64: { |
| 399 | dist: { |
| 400 | dir: "simpleperf/darwin/x86_64", |
| 401 | }, |
| 402 | }, |
| 403 | linux_glibc_x86: { |
| 404 | dist: { |
| 405 | dir: "simpleperf/linux/x86", |
| 406 | }, |
| 407 | }, |
| 408 | linux_glibc_x86_64: { |
| 409 | dist: { |
| 410 | dir: "simpleperf/linux/x86_64", |
| 411 | }, |
| 412 | }, |
| 413 | windows_x86: { |
| 414 | dist: { |
| 415 | dir: "simpleperf/windows/x86", |
| 416 | }, |
| 417 | }, |
| 418 | windows_x86_64: { |
| 419 | dist: { |
| 420 | dir: "simpleperf/windows/x86_64", |
| 421 | }, |
| 422 | }, |
| 423 | }, |
| 424 | } |
| 425 | |
| 426 | // It's linked to user's program, to get profile counters and samples for specific code ranges. |
| 427 | cc_library { |
| 428 | name: "libsimpleperf_record", |
| 429 | defaults: [ |
| 430 | "simpleperf_static_libs", |
| 431 | ], |
| 432 | export_include_dirs: ["include"], |
| 433 | ldflags: ["-Wl,--exclude-libs,ALL"], |
| 434 | srcs: [ |
| 435 | "record_lib_interface.cpp", |
| 436 | ], |
| 437 | static_libs: [ |
| 438 | "libsimpleperf" |
| 439 | ], |
| 440 | target: { |
| 441 | darwin: { |
| 442 | enabled: false, |
| 443 | }, |
| 444 | windows: { |
| 445 | enabled: false, |
| 446 | }, |
| 447 | }, |
| 448 | } |
| 449 | |
| 450 | // It's the shared library used on host by python scripts to report samples in different ways. |
| 451 | cc_library_shared { |
| 452 | name: "libsimpleperf_report", |
| 453 | defaults: [ |
| 454 | "simpleperf_static_libs", |
| 455 | ], |
| 456 | dist: { |
Elliott Hughes | d435d36 | 2019-04-02 13:00:55 -0700 | [diff] [blame] | 457 | targets: ["sdk", "win_sdk", "simpleperf"], |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 458 | }, |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 459 | srcs: [ |
| 460 | "report_lib_interface.cpp", |
| 461 | ], |
| 462 | static_libs: ["libsimpleperf"], |
| 463 | |
| 464 | target: { |
| 465 | android: { |
| 466 | enabled: false, |
| 467 | }, |
Yabin Cui | 15fc25d | 2019-01-30 11:03:40 -0800 | [diff] [blame] | 468 | linux: { |
| 469 | ldflags: ["-Wl,--exclude-libs,ALL"], |
| 470 | }, |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 471 | darwin: { |
| 472 | dist: { |
| 473 | dir: "simpleperf/darwin/x86", |
| 474 | }, |
| 475 | }, |
| 476 | darwin_x86_64: { |
| 477 | dist: { |
| 478 | dir: "simpleperf/darwin/x86_64", |
| 479 | }, |
| 480 | }, |
| 481 | linux_glibc_x86: { |
| 482 | dist: { |
| 483 | dir: "simpleperf/linux/x86", |
| 484 | }, |
| 485 | }, |
| 486 | linux_glibc_x86_64: { |
| 487 | dist: { |
| 488 | dir: "simpleperf/linux/x86_64", |
| 489 | }, |
| 490 | }, |
| 491 | windows_x86: { |
| 492 | dist: { |
| 493 | dir: "simpleperf/windows/x86", |
| 494 | }, |
| 495 | }, |
| 496 | windows_x86_64: { |
| 497 | dist: { |
| 498 | dir: "simpleperf/windows/x86_64", |
| 499 | }, |
| 500 | }, |
| 501 | }, |
| 502 | } |
| 503 | |
| 504 | // It's the shared library linked with user's app and get samples from signal handlers in each |
| 505 | // thread. Doesn't work yet. |
| 506 | cc_library_shared { |
| 507 | name: "libsimpleperf_inplace_sampler", |
| 508 | defaults: [ |
| 509 | "simpleperf_static_libs", |
| 510 | ], |
| 511 | export_include_dirs: ["include"], |
| 512 | ldflags: ["-Wl,--exclude-libs,ALL"], |
| 513 | srcs: [ |
| 514 | "inplace_sampler_lib.cpp", |
| 515 | ], |
| 516 | static_libs: ["libsimpleperf"], |
| 517 | target: { |
| 518 | darwin: { |
| 519 | enabled: false, |
| 520 | }, |
| 521 | windows: { |
| 522 | enabled: false, |
| 523 | }, |
| 524 | }, |
| 525 | } |
| 526 | |
| 527 | cc_defaults { |
| 528 | name: "simpleperf_test_srcs", |
| 529 | srcs: [ |
| 530 | "cmd_kmem_test.cpp", |
| 531 | "cmd_report_test.cpp", |
| 532 | "cmd_report_sample_test.cpp", |
| 533 | "command_test.cpp", |
| 534 | "dso_test.cpp", |
| 535 | "gtest_main.cpp", |
| 536 | "read_apk_test.cpp", |
| 537 | "read_elf_test.cpp", |
| 538 | "record_test.cpp", |
| 539 | "sample_tree_test.cpp", |
| 540 | "thread_tree_test.cpp", |
| 541 | "utils_test.cpp", |
| 542 | ], |
| 543 | target: { |
| 544 | linux: { |
| 545 | srcs: [ |
| 546 | "CallChainJoiner_test.cpp", |
| 547 | "cmd_debug_unwind_test.cpp", |
| 548 | "cmd_dumprecord_test.cpp", |
| 549 | "cmd_list_test.cpp", |
| 550 | "cmd_record_test.cpp", |
| 551 | "cmd_stat_test.cpp", |
| 552 | "cmd_trace_sched_test.cpp", |
| 553 | "environment_test.cpp", |
| 554 | "IOEventLoop_test.cpp", |
| 555 | "read_dex_file_test.cpp", |
| 556 | "record_file_test.cpp", |
| 557 | "RecordReadThread_test.cpp", |
| 558 | "UnixSocket_test.cpp", |
| 559 | "workload_test.cpp", |
| 560 | ], |
| 561 | }, |
| 562 | }, |
| 563 | } |
| 564 | |
| 565 | cc_test { |
| 566 | name: "simpleperf_unit_test", |
| 567 | defaults: [ |
| 568 | "simpleperf_test_srcs", |
Yabin Cui | bcbffab | 2019-02-27 10:53:16 -0800 | [diff] [blame] | 569 | "simpleperf_libs_for_tests", |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 570 | ], |
| 571 | static_libs: [ |
| 572 | "libgmock", |
| 573 | "libsimpleperf" |
| 574 | ], |
| 575 | target: { |
| 576 | android: { |
| 577 | test_suites: ["device-tests"], |
| 578 | }, |
| 579 | }, |
| 580 | data: [ |
| 581 | "testdata/**/*", |
| 582 | ], |
| 583 | } |
| 584 | |
| 585 | cc_test { |
| 586 | name: "simpleperf_cpu_hotplug_test", |
| 587 | defaults: [ |
Yabin Cui | bcbffab | 2019-02-27 10:53:16 -0800 | [diff] [blame] | 588 | "simpleperf_libs_for_tests", |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 589 | ], |
| 590 | srcs: [ |
| 591 | "cpu_hotplug_test.cpp", |
| 592 | ], |
| 593 | static_libs: ["libsimpleperf"], |
| 594 | target: { |
| 595 | android: { |
| 596 | test_suites: ["device-tests"], |
| 597 | }, |
| 598 | darwin: { |
| 599 | enabled: false, |
| 600 | }, |
| 601 | windows: { |
| 602 | enabled: false, |
| 603 | }, |
| 604 | }, |
| 605 | } |
| 606 | |
| 607 | cc_library_static { |
| 608 | name: "libsimpleperf_cts_test", |
| 609 | defaults: [ |
| 610 | "simpleperf_test_srcs", |
Yabin Cui | bcbffab | 2019-02-27 10:53:16 -0800 | [diff] [blame] | 611 | "simpleperf_libs_for_tests", |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 612 | ], |
| 613 | host_supported: false, |
| 614 | cflags: [ |
Yabin Cui | a24cf96 | 2019-01-29 17:06:42 -0800 | [diff] [blame] | 615 | "-DIN_CTS_TEST", |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 616 | ], |
| 617 | static_libs: [ |
| 618 | "libgtest", |
| 619 | ], |
| 620 | whole_static_libs: [ |
| 621 | "libgmock", |
| 622 | "libsimpleperf", |
| 623 | ], |
| 624 | } |
| 625 | |
| 626 | cc_test { |
| 627 | name: "simpleperf_record_test", |
| 628 | defaults: [ |
Yabin Cui | bcbffab | 2019-02-27 10:53:16 -0800 | [diff] [blame] | 629 | "simpleperf_libs_for_tests", |
Yabin Cui | f6e5e0a | 2019-01-22 10:54:13 -0800 | [diff] [blame] | 630 | ], |
| 631 | srcs: [ |
| 632 | "record_lib_test.cpp", |
| 633 | ], |
| 634 | shared_libs: ["libsimpleperf_record"], |
| 635 | target: { |
| 636 | android: { |
| 637 | test_suites: ["device-tests"], |
| 638 | }, |
| 639 | darwin: { |
| 640 | enabled: false, |
| 641 | }, |
| 642 | windows: { |
| 643 | enabled: false, |
| 644 | }, |
| 645 | }, |
Martin Stjernholm | 31eb7a0 | 2019-01-24 15:38:49 +0000 | [diff] [blame] | 646 | } |