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 "trace_stdtype/xpower/xpower_stdtype.cpp", 45 ] 46 47 if (!is_independent_compile) { 48 configs = [ "${TS_DIR}/gn:ts_config" ] 49 } 50 if (enable_ts_utest && !use_wasm) { 51 cflags = [ 52 "-fprofile-arcs", 53 "-ftest-coverage", 54 ] 55 ldflags = [ 56 "-fprofile-arcs", 57 "-ftest-coverage", 58 "--coverage", 59 ] 60 if (is_test) { 61 cflags += [ "-D IS_UT" ] 62 } 63 } 64 include_dirs = [ 65 "${THIRD_PARTY}/sqlite/include", 66 "${SRC}", 67 "${SRC}/base", 68 "${SRC}/cfg", 69 "${SRC}/include", 70 "${SRC}/table", 71 "${SRC}/table/base/include", 72 "${SRC}/table/ebpf/include", 73 "${SRC}/table/ftrace/include", 74 "${SRC}/table/hiperf/include", 75 "${SRC}/table/hi_sysevent/include", 76 "${SRC}/table/js_memory/include", 77 "${SRC}/table/monitor/include", 78 "${SRC}/table/native_hook/include", 79 "${SRC}/table/xpower/include", 80 ".", 81 "${THIRD_PARTY}/protobuf/src", 82 "${THIRD_PARTY}/bounds_checking_function/include", 83 "${THIRD_PARTY}/json/single_include/nlohmann", 84 "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/nonlinux", 85 "${SRC}/trace_data/trace_stdtype", 86 "${SRC}/trace_data/trace_stdtype/ftrace", 87 "${SRC}/trace_data/trace_stdtype/ftrace/template", 88 "${SRC}/trace_data/trace_stdtype/hilog", 89 "${SRC}/trace_data/trace_stdtype/hiperf", 90 "${SRC}/trace_data/trace_stdtype/hisysevent", 91 "${SRC}/trace_data/trace_stdtype/htrace", 92 "${SRC}/trace_data/trace_stdtype/measure", 93 "${SRC}/trace_data/trace_stdtype/xpower", 94 ] 95 96 deps = [ 97 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/smartperf_host:ts_all_sph_cpp", 98 ] 99 public_deps = [ "${SRC}/base:base" ] 100 public_configs = [ "${SRC}/base/sqlite_ext:sqlite_ext_cfg" ] 101} 102