# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/hiviewdfx/hiview/hiview.gni") import("//build/ohos.gni") config("unified_collector_config") { visibility = [ "*:*" ] include_dirs = [ "app_trace/include", "include", "observer/include", "storage/include", "task/include", "power/include", "$hiview_framework/native/unified_collection/collector/inner_include", "$hiview_framework/native/unified_collection/process/include", "$hiview_framework/native/unified_collection/decorator/include", ] defines = [ "PC_APP_STATE_COLLECT_ENABLE = $hiview_unified_collector_PC_app_state_collect_enable" ] } ohos_source_set("unified_collector") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true cfi_vcall_icall_only = true debug = false } configs = [ ":unified_collector_config" ] sources = [ "$hiview_framework/native/unified_collection/decorator/unified_collection_stat.cpp", "app_trace/app_trace_context.cpp", "observer/uc_app_state_observer.cpp", "observer/uc_observer_mgr.cpp", "observer/uc_render_state_observer.cpp", "observer/uc_system_ability_listener.cpp", "storage/cpu_storage.cpp", "task/cpu_collection_task.cpp", "task/cpu_perf_dump.cpp", "unified_collector.cpp", ] deps = [ "$hiview_base:hiviewbase", "$hiview_interfaces/inner_api/unified_collection/utility:libucollection_graphic", "$hiview_interfaces/inner_api/unified_collection/utility:libucollection_utility", "config:UnifiedCollector_event", ] external_deps = [ "ability_runtime:app_manager", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_dump", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (has_hiperf) { cflags = [ "-DHAS_HIPERF" ] } if (power_manager_enable) { external_deps += [ "common_event_service:cesfwk_innerkits", "power_manager:powermgr_client", ] sources += [ "power/power_status_manager.cpp" ] defines = [ "POWER_MANAGER_ENABLE" ] } part_name = "hiview" subsystem_name = "hiviewdfx" } group("unittest") { testonly = true deps = [ "test/unittest/common:CpuStorageTest", "test/unittest/common:TraceStateChangeTest", "test/unittest/common:UCStateObserverTest", ] } group("moduletest") { testonly = true deps = [] }