1# Copyright (c) 2025 Huawei Device Co., Ltd. 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("//base/hiviewdfx/hiview/hiview.gni") 15import("//build/ohos.gni") 16 17config("trace_manager_config") { 18 visibility = [ "*:*" ] 19 include_dirs = [ 20 "include", 21 "state/include", 22 "storage/include", 23 "telemetry/include", 24 "$hiview_base/include", 25 "$hiview_base/utility/include", 26 "$hiview_base/event_raw/include", 27 ] 28} 29 30ohos_prebuilt_etc("trace_quota_config.json") { 31 source = "config/trace_quota_config.json" 32 relative_install_dir = "hiview" 33 part_name = "hiview" 34 subsystem_name = "hiviewdfx" 35} 36 37ohos_source_set("trace_manager_source") { 38 branch_protector_ret = "pac_ret" 39 sanitize = { 40 cfi = true 41 cfi_cross_dso = true 42 cfi_vcall_icall_only = true 43 debug = false 44 } 45 46 public_configs = [ ":trace_manager_config" ] 47 sources = [ 48 "src/trace_db_callback.cpp", 49 "src/trace_flow_controller.cpp", 50 "src/trace_state_machine.cpp", 51 "state/trace_base_state.cpp", 52 "state/trace_command_state.cpp", 53 "state/trace_common_state.cpp", 54 "state/trace_dynamic_state.cpp", 55 "state/trace_telemetry_state.cpp", 56 "storage/app_event_task_storage.cpp", 57 "storage/telemetry_storage.cpp", 58 "storage/trace_behavior_storage.cpp", 59 "storage/trace_storage.cpp", 60 "telemetry/telemetry_state_machine.cpp", 61 ] 62 63 deps = [ 64 ":trace_quota_config.json", 65 "$hiview_base:hiviewbase", 66 ] 67 68 external_deps = [ 69 "cJSON:cjson", 70 "c_utils:utils", 71 "ffrt:libffrt", 72 "hilog:libhilog", 73 "hitrace:hitrace_dump", 74 "hitrace:libhitrace_option", 75 "relational_store:native_rdb", 76 ] 77 78 part_name = "hiview" 79 subsystem_name = "hiviewdfx" 80} 81 82ohos_shared_library("libtrace_manager") { 83 branch_protector_ret = "pac_ret" 84 sanitize = { 85 cfi = true 86 cfi_cross_dso = true 87 cfi_vcall_icall_only = true 88 debug = false 89 } 90 91 public_configs = [ ":trace_manager_config" ] 92 93 deps = [ ":trace_manager_source" ] 94 95 public_external_deps = [ 96 "ffrt:libffrt", 97 "hilog:libhilog", 98 "hitrace:hitrace_dump", 99 "relational_store:native_rdb", 100 ] 101 102 version_script = "libtracemanager.map" 103 104 part_name = "hiview" 105 subsystem_name = "hiviewdfx" 106} 107