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")
15import("../../build/ts.gni")
16
17ohos_source_set("trace_data") {
18  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
19  part_name = "${OHOS_PROFILER_PART_NAME}"
20  sources = [
21    "sqllite_prepar_cache_data.cpp",
22    "trace_data_cache.cpp",
23    "trace_data_cache_base.cpp",
24    "trace_data_cache_reader.cpp",
25    "trace_data_cache_writer.cpp",
26    "trace_data_db.cpp",
27    "trace_stdtype/base_stdtype.cpp",
28    "trace_stdtype/common_stdtype.cpp",
29    "trace_stdtype/ftrace/callstack_stdtype.cpp",
30    "trace_stdtype/ftrace/render_service_stdtype.cpp",
31    "trace_stdtype/ftrace/sched_stdtype.cpp",
32    "trace_stdtype/ftrace/syscall_stdtype.cpp",
33    "trace_stdtype/ftrace/template/animation_stdtype.cpp",
34    "trace_stdtype/ftrace/template/app_startup_stdtype.cpp",
35    "trace_stdtype/ftrace/template/task_pool_stdtype.cpp",
36    "trace_stdtype/hilog/hilog_stdtype.cpp",
37    "trace_stdtype/hiperf/hiperf_stdtype.cpp",
38    "trace_stdtype/hisysevent/hisysevent_stdtype.cpp",
39    "trace_stdtype/htrace/activity_monitor_stdtype.cpp",
40    "trace_stdtype/htrace/arkts_stdtype.cpp",
41    "trace_stdtype/htrace/ebpf_stdtype.cpp",
42    "trace_stdtype/htrace/native_memory_stdtype.cpp",
43    "trace_stdtype/measure/measure_stdtype.cpp",
44  ]
45
46  if (!is_independent_compile) {
47    configs = [ "${TS_DIR}/gn:ts_config" ]
48  }
49  if (enable_ts_utest && !use_wasm) {
50    cflags = [
51      "-fprofile-arcs",
52      "-ftest-coverage",
53    ]
54    ldflags = [
55      "-fprofile-arcs",
56      "-ftest-coverage",
57      "--coverage",
58    ]
59    if (is_test) {
60      cflags += [ "-D IS_UT" ]
61    }
62  }
63  include_dirs = [
64    "${THIRD_PARTY}/sqlite/include",
65    "${SRC}",
66    "${SRC}/base",
67    "${SRC}/include",
68    "${SRC}/table",
69    "${SRC}/table/base/include",
70    "${SRC}/table/ebpf/include",
71    "${SRC}/table/ftrace/include",
72    "${SRC}/table/hiperf/include",
73    "${SRC}/table/hi_sysevent/include",
74    "${SRC}/table/js_memory/include",
75    "${SRC}/table/monitor/include",
76    "${SRC}/table/native_hook/include",
77    ".",
78    "${THIRD_PARTY}/protobuf/src",
79    "${THIRD_PARTY}/bounds_checking_function/include",
80    "${THIRD_PARTY}/json/single_include/nlohmann",
81    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/nonlinux",
82    "${SRC}/trace_data/trace_stdtype",
83    "${SRC}/trace_data/trace_stdtype/ftrace",
84    "${SRC}/trace_data/trace_stdtype/ftrace/template",
85    "${SRC}/trace_data/trace_stdtype/hilog",
86    "${SRC}/trace_data/trace_stdtype/hiperf",
87    "${SRC}/trace_data/trace_stdtype/hisysevent",
88    "${SRC}/trace_data/trace_stdtype/htrace",
89    "${SRC}/trace_data/trace_stdtype/measure",
90  ]
91
92  deps = [
93    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/smartperf_host:ts_all_sph_cpp",
94  ]
95
96  public_configs = [
97    "${SRC}/parser/ebpf_parser:ebpf_parser_cfg",
98    "${SRC}/base/sqlite_ext:sqlite_ext_cfg",
99  ]
100}
101