1# Copyright (c) 2021-2024 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. 13import("//base/hiviewdfx/hiview/hiview.gni") 14import("//build/ohos.gni") 15 16ohos_source_set("faultlogger_service") { 17 part_name = "hiview" 18 subsystem_name = "hiviewdfx" 19 include_dirs = [ 20 ".", 21 "$hiview_plugin/faultlogger/common", 22 "$hiview_plugin/faultlogger/service/fault_event/event", 23 "$hiview_plugin/faultlogger/service/fault_event/factory", 24 "$hiview_plugin/faultlogger/service/fault_event/base", 25 "$hiview_plugin/faultlogger/service/fault_file", 26 "$hiview_plugin/faultlogger/service/page_history", 27 "$hiview_plugin/faultlogger/service/sanitizer_collector", 28 "$hiview_framework/native/unified_collection/process/include", 29 ] 30 31 sources = [ 32 "fault_event/base/faultlog_event_base.cpp", 33 "fault_event/base/faultlog_processor_base.cpp", 34 "fault_event/event/faultlog_cjerror.cpp", 35 "fault_event/event/faultlog_cppcrash.cpp", 36 "fault_event/event/faultlog_error_reporter.cpp", 37 "fault_event/event/faultlog_events_processor.cpp", 38 "fault_event/event/faultlog_freeze.cpp", 39 "fault_event/event/faultlog_jserror.cpp", 40 "fault_event/event/faultlog_rust_panic.cpp", 41 "fault_event/event/faultlog_sanitizer.cpp", 42 "fault_event/event/freeze_json_generator.cpp", 43 "fault_event/factory/faultlog_event_factory.cpp", 44 "fault_event/factory/faultlog_processor_factory.cpp", 45 "fault_file/faultlog_bootscan.cpp", 46 "fault_file/faultlog_database.cpp", 47 "fault_file/faultlog_dump.cpp", 48 "fault_file/faultlog_formatter.cpp", 49 "fault_file/faultlog_manager.cpp", 50 "faultlog_manager_service.cpp", 51 "faultlogger.cpp", 52 "page_history/page_history_manager.cpp", 53 "page_history/page_history_recorder.cpp", 54 "page_history/pages_trace.cpp", 55 "sanitizer_collector/sanitizer_telemetry.cpp", 56 ] 57 58 deps = [ 59 "$hiview_base:hiviewbase", 60 "$hiview_interfaces/inner_api/unified_collection/utility:libucollection_utility", 61 "$hiview_plugin/faultlogger/common:faultlogger_common", 62 "$hiview_plugin/faultlogger/common:log_analyzer", 63 "idl:faultlogger_service_impl", 64 ] 65 66 external_deps = [ 67 "access_token:libaccesstoken_sdk", 68 "bounds_checking_function:libsec_shared", 69 "bundle_framework:appexecfwk_base", 70 "bundle_framework:appexecfwk_core", 71 "c_utils:utils", 72 "faultloggerd:crash_exception", 73 "ffrt:libffrt", 74 "hilog:libhilog", 75 "hitrace:libhitracechain", 76 "hisysevent:libhisysevent", 77 "init:libbegetutil", 78 "ipc:ipc_single", 79 "jsoncpp:jsoncpp", 80 "safwk:system_ability_fwk", 81 "samgr:samgr_proxy", 82 ] 83} 84 85ohos_source_set("faultlogger_service_with_cfi") { 86 sanitize = { 87 cfi = true 88 cfi_cross_dso = true 89 cfi_vcall_icall_only = true 90 debug = false 91 } 92 part_name = "hiview" 93 subsystem_name = "hiviewdfx" 94 include_dirs = [ 95 ".", 96 "$hiview_plugin/faultlogger/common", 97 "$hiview_plugin/faultlogger/service/fault_event/event", 98 "$hiview_plugin/faultlogger/service/fault_event/factory", 99 "$hiview_plugin/faultlogger/service/fault_event/base", 100 "$hiview_plugin/faultlogger/service/fault_file", 101 "$hiview_plugin/faultlogger/service/page_history", 102 "$hiview_plugin/faultlogger/service/sanitizer_collector", 103 "$hiview_framework/native/unified_collection/process/include", 104 ] 105 106 sources = [ 107 "fault_event/base/faultlog_event_base.cpp", 108 "fault_event/base/faultlog_processor_base.cpp", 109 "fault_event/event/faultlog_cjerror.cpp", 110 "fault_event/event/faultlog_cppcrash.cpp", 111 "fault_event/event/faultlog_error_reporter.cpp", 112 "fault_event/event/faultlog_events_processor.cpp", 113 "fault_event/event/faultlog_freeze.cpp", 114 "fault_event/event/faultlog_jserror.cpp", 115 "fault_event/event/faultlog_rust_panic.cpp", 116 "fault_event/event/faultlog_sanitizer.cpp", 117 "fault_event/event/freeze_json_generator.cpp", 118 "fault_event/factory/faultlog_event_factory.cpp", 119 "fault_event/factory/faultlog_processor_factory.cpp", 120 "fault_file/faultlog_bootscan.cpp", 121 "fault_file/faultlog_database.cpp", 122 "fault_file/faultlog_dump.cpp", 123 "fault_file/faultlog_formatter.cpp", 124 "fault_file/faultlog_manager.cpp", 125 "faultlog_manager_service.cpp", 126 "faultlogger.cpp", 127 "sanitizer_collector/sanitizer_telemetry.cpp", 128 ] 129 130 deps = [ 131 "$hiview_base:hiviewbase", 132 "$hiview_interfaces/inner_api/unified_collection/utility:libucollection_utility", 133 "$hiview_plugin/faultlogger/common:faultlogger_common_with_cfi", 134 "$hiview_plugin/faultlogger/common:log_analyzer_with_cfi", 135 "idl:faultlogger_service_impl_with_cfi", 136 "page_history:page_history_with_cfi", 137 ] 138 139 external_deps = [ 140 "access_token:libaccesstoken_sdk", 141 "bounds_checking_function:libsec_shared", 142 "bundle_framework:appexecfwk_base", 143 "bundle_framework:appexecfwk_core", 144 "c_utils:utils", 145 "faultloggerd:crash_exception", 146 "ffrt:libffrt", 147 "hilog:libhilog", 148 "hitrace:libhitracechain", 149 "hisysevent:libhisysevent", 150 "init:libbegetutil", 151 "ipc:ipc_single", 152 "jsoncpp:jsoncpp", 153 "safwk:system_ability_fwk", 154 "samgr:samgr_proxy", 155 ] 156} 157 158ohos_source_set("faultlogger_service_fuzz_src") { 159 part_name = "hiview" 160 subsystem_name = "hiviewdfx" 161 include_dirs = [ 162 ".", 163 "$hiview_plugin/faultlogger/common", 164 "$hiview_plugin/faultlogger/service/fault_event/event", 165 "$hiview_plugin/faultlogger/service/fault_event/factory", 166 "$hiview_plugin/faultlogger/service/fault_event/base", 167 "$hiview_plugin/faultlogger/service/fault_file", 168 "$hiview_plugin/faultlogger/service/page_history", 169 "$hiview_plugin/faultlogger/service/sanitizer_collector", 170 "$hiview_framework/native/unified_collection/process/include", 171 ] 172 defines = [ "UNIT_TEST" ] 173 defines += [ "UNITTEST" ] 174 175 sources = [ 176 "fault_event/base/faultlog_event_base.cpp", 177 "fault_event/base/faultlog_processor_base.cpp", 178 "fault_event/event/faultlog_cjerror.cpp", 179 "fault_event/event/faultlog_cppcrash.cpp", 180 "fault_event/event/faultlog_error_reporter.cpp", 181 "fault_event/event/faultlog_events_processor.cpp", 182 "fault_event/event/faultlog_freeze.cpp", 183 "fault_event/event/faultlog_jserror.cpp", 184 "fault_event/event/faultlog_rust_panic.cpp", 185 "fault_event/event/faultlog_sanitizer.cpp", 186 "fault_event/event/freeze_json_generator.cpp", 187 "fault_event/factory/faultlog_event_factory.cpp", 188 "fault_event/factory/faultlog_processor_factory.cpp", 189 "fault_file/faultlog_bootscan.cpp", 190 "fault_file/faultlog_database.cpp", 191 "fault_file/faultlog_dump.cpp", 192 "fault_file/faultlog_formatter.cpp", 193 "fault_file/faultlog_manager.cpp", 194 "faultlog_manager_service.cpp", 195 "faultlogger.cpp", 196 "page_history/page_history_manager.cpp", 197 "page_history/page_history_recorder.cpp", 198 "page_history/pages_trace.cpp", 199 "sanitizer_collector/sanitizer_telemetry.cpp", 200 ] 201 202 deps = [ 203 "$hiview_base:hiviewbase", 204 "$hiview_interfaces/inner_api/unified_collection/utility:libucollection_utility", 205 "$hiview_plugin/faultlogger/common:faultlogger_common", 206 "$hiview_plugin/faultlogger/common:log_analyzer", 207 "idl:faultlogger_service_impl", 208 ] 209 210 external_deps = [ 211 "access_token:libaccesstoken_sdk", 212 "bounds_checking_function:libsec_shared", 213 "bundle_framework:appexecfwk_base", 214 "bundle_framework:appexecfwk_core", 215 "c_utils:utils", 216 "faultloggerd:crash_exception", 217 "ffrt:libffrt", 218 "hilog:libhilog", 219 "hitrace:libhitracechain", 220 "hisysevent:libhisysevent", 221 "init:libbegetutil", 222 "ipc:ipc_single", 223 "jsoncpp:jsoncpp", 224 "safwk:system_ability_fwk", 225 "zlib:libz", 226 ] 227} 228