1# Copyright (C) 2020 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15import("../../../gn/perfetto.gni") 16import("../../../gn/test.gni") 17 18# Core tracing library, platform independent, no IPC layer, no service. 19source_set("core") { 20 public_deps = [ 21 "../../../include/perfetto/ext/tracing/core", 22 "../../protozero", 23 ] 24 deps = [ 25 "..:common", 26 "../../../gn:default_deps", 27 "../../../include/perfetto/tracing", 28 "../../../protos/perfetto/trace:zero", 29 "../../base", 30 ] 31 sources = [ 32 "clock_snapshots.cc", 33 "id_allocator.cc", 34 "id_allocator.h", 35 "in_process_shared_memory.cc", 36 "in_process_shared_memory.h", 37 "null_trace_writer.cc", 38 "null_trace_writer.h", 39 "patch_list.h", 40 "shared_memory_abi.cc", 41 "shared_memory_arbiter_impl.cc", 42 "shared_memory_arbiter_impl.h", 43 "trace_packet.cc", 44 "trace_writer_impl.cc", 45 "trace_writer_impl.h", 46 "virtual_destructors.cc", 47 ] 48} 49 50perfetto_unittest_source_set("unittests") { 51 testonly = true 52 deps = [ 53 ":core", 54 "../../../gn:default_deps", 55 "../../../gn:gtest_and_gmock", 56 "../../../protos/perfetto/trace:cpp", 57 "../../../protos/perfetto/trace:zero", 58 "../../../protos/perfetto/trace/ftrace:cpp", 59 "../../../protos/perfetto/trace/perfetto:cpp", 60 "../../../src/protozero/filtering:bytecode_generator", 61 "../../base", 62 "../../base:test_support", 63 "../test:test_support", 64 ] 65 66 sources = [ 67 "id_allocator_unittest.cc", 68 "null_trace_writer_unittest.cc", 69 "patch_list_unittest.cc", 70 "shared_memory_abi_unittest.cc", 71 "trace_packet_unittest.cc", 72 ] 73 74 # These tests rely on test_task_runner.h which 75 # has no Windows implementation. 76 if (!is_win) { 77 sources += [ 78 "shared_memory_arbiter_impl_unittest.cc", 79 "trace_writer_impl_unittest.cc", 80 ] 81 } 82} 83 84perfetto_unittest_source_set("test_support") { 85 testonly = true 86 public_deps = [ 87 "../../../include/perfetto/ext/tracing/core", 88 "../../../protos/perfetto/trace:cpp", 89 "../../../protos/perfetto/trace:zero", 90 "../../protozero", 91 ] 92 sources = [ 93 "trace_writer_for_testing.cc", 94 "trace_writer_for_testing.h", 95 ] 96} 97