1# Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15
16import("../../../build/ts.gni")
17ohos_source_set("ftrace_tables") {
18  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
19  part_name = "${OHOS_PROFILER_PART_NAME}"
20  sources = [
21    "animation_table.cpp",
22    "app_startup_table.cpp",
23    "callstack_table.cpp",
24    "clk_event_filter_table.cpp",
25    "clock_event_filter_table.cpp",
26    "clock_snapshot_table.cpp",
27    "cpu_measure_filter_table.cpp",
28    "dma_fence_table.cpp",
29    "dynamic_frame_table.cpp",
30    "filter_table.cpp",
31    "frame_maps_table.cpp",
32    "frame_slice_table.cpp",
33    "gpu_slice_table.cpp",
34    "instants_table.cpp",
35    "irq_table.cpp",
36    "measure_table.cpp",
37    "process_measure_filter_table.cpp",
38    "process_table.cpp",
39    "raw_table.cpp",
40    "sched_slice_table.cpp",
41    "so_static_initalization_table.cpp",
42    "system_call_table.cpp",
43    "system_event_filter_table.cpp",
44    "task_pool_table.cpp",
45    "thread_state_table.cpp",
46    "thread_table.cpp",
47  ]
48
49  include_dirs = [ "include" ]
50  public_configs = [ "${SRC}/table/base:base_tables_cfg" ]
51
52  if (!is_independent_compile) {
53    configs = [ "${TS_DIR}/gn:ts_config" ]
54  }
55  if (enable_ts_utest && !use_wasm) {
56    cflags = [
57      "-fprofile-arcs",
58      "-ftest-coverage",
59    ]
60    ldflags = [
61      "-fprofile-arcs",
62      "-ftest-coverage",
63      "--coverage",
64    ]
65    if (is_test) {
66      cflags += [ "-D IS_UT" ]
67    }
68  }
69}
70