# Copyright (c) 2021 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("../hidumper.gni") config("interface_include") { include_dirs = [ "${hidumper_interface}/innerkits/include", "${hidumper_interface}/native/innerkits/include/", ] } config("service_config") { include_dirs = [ "native/include" ] } config("zidl_config") { include_dirs = [ "zidl/include" ] } config("zidl_cpu_config") { include_dirs = [ "zidl/include", "${hidumper_frameworks_path}/include", ] } config("dump_cpu_config") { visibility = [ "*:*" ] include_dirs = [ "native/include", "${hidumper_frameworks_path}/include", "${hidumper_interface}/innerkits/include", "zidl/include", "${hidumper_utils_path}/native/include", "${hidumper_frameworks_path}", ] } ohos_source_set("zidl_client") { sources = [ "zidl/src/dump_broker_cpu_proxy.cpp", "zidl/src/dump_broker_proxy.cpp", ] configs = [ "${hidumper_utils_path}:utils_config", ":interface_include", "${hidumper_service_path}:zidl_cpu_config", ] deps = [ "${hidumper_utils_path}:utils" ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } ohos_source_set("zidl_service") { sources = [ "zidl/src/dump_broker_stub.cpp" ] configs = [ "${hidumper_utils_path}:utils_config", ":interface_include", "${hidumper_service_path}:zidl_config", ] deps = [ "${hidumper_utils_path}:utils" ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } ohos_source_set("zidl_cpu_service") { sources = [ "zidl/src/dump_broker_cpu_stub.cpp" ] configs = [ "${hidumper_utils_path}:utils_config", ":interface_include", ":service_config", "${hidumper_service_path}:zidl_cpu_config", ] deps = [ "${hidumper_utils_path}:utils" ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } ohos_shared_library("hidumper_client") { branch_protector_ret = "pac_ret" sources = [ "native/src/dump_cpu_data.cpp", "native/src/dump_manager_client.cpp", "native/src/dump_manager_cpu_client.cpp", "native/src/dump_on_demand_load.cpp", ] configs = [ "${hidumper_utils_path}:utils_config", ":interface_include", "${hidumper_frameworks_path}:hidumper_include", "${hidumper_service_path}:service_config", "${hidumper_service_path}:zidl_config", ] deps = [ "${hidumper_service_path}:zidl_client", "${hidumper_utils_path}:utils", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] version_script = "hidumper.map" subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } ohos_source_set("hidumperservice_source") { sources = [ "native/src/dump_common_utils.cpp", "native/src/dump_cpu_data.cpp", "native/src/dump_log_manager.cpp", "native/src/dump_manager_cpu_client.cpp", "native/src/dump_manager_service.cpp", "native/src/dump_on_demand_load.cpp", "native/src/raw_param.cpp", "zidl/src/dump_broker_cpu_proxy.cpp", ] configs = [ "${hidumper_utils_path}:utils_config", ":interface_include", "${hidumper_frameworks_path}:hidumper_include", "${hidumper_service_path}:service_config", "${hidumper_service_path}:zidl_config", ] deps = [ "${hidumper_frameworks_path}:dump_main", "${hidumper_service_path}:zidl_service", "${hidumper_utils_path}:utils", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } ohos_shared_library("hidumperservice_cpu_source") { if (hidumper_hiviewdfx_hiview_enable) { public_configs = [ ":dump_cpu_config" ] sources = [ "native/src/dump_manager_cpu_service.cpp" ] configs = [ "${hidumper_utils_path}:utils_config", ":interface_include", "${hidumper_frameworks_path}:hidumper_include", "${hidumper_service_path}:service_config", "${hidumper_service_path}:zidl_config", ] deps = [ "${hidumper_service_path}:hidumperservice_source", "${hidumper_service_path}:zidl_cpu_service", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", "hiview:libucollection_utility", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [] if (hidumper_ablility_base_enable) { external_deps += [ "ability_base:want" ] external_deps += [ "ability_runtime:app_manager" ] defines += [ "HIDUMPER_ABILITY_BASE_ENABLE" ] } sanitize = { cfi = true cfi_cross_dso = true cfi_no_nvcall = true cfi_vcall_icall_only = true debug = false } version_script = "hidumper.map" subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } } ohos_source_set("hidumperservice_cpu_source_test") { sources = [ "native/src/dump_manager_cpu_service.cpp" ] configs = [ "${hidumper_utils_path}:utils_config", ":interface_include", "${hidumper_frameworks_path}:hidumper_include", "${hidumper_service_path}:service_config", "${hidumper_service_path}:zidl_config", ] deps = [ "${hidumper_service_path}:zidl_cpu_service" ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libtokensetproc_shared", "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", "hiview:libucollection_utility", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [] if (hidumper_ablility_base_enable) { external_deps += [ "ability_base:want" ] external_deps += [ "ability_runtime:app_manager" ] defines += [ "HIDUMPER_ABILITY_BASE_ENABLE" ] } subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } ohos_shared_library("hidumperservice") { deps = [ ":hidumperservice_source" ] external_deps = [ "hilog:libhilog" ] cflags = [ "-fstack-protector-strong" ] install_enable = true version_script = "hidumper.map" shlib_type = "sa" subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } ohos_source_set("hidumpermemory_source") { sources = [ "${hidumper_frameworks_path}/dump_utils.cpp", "${hidumper_frameworks_path}/src/common/dump_cfg.cpp", "${hidumper_frameworks_path}/src/common/dumper_opts.cpp", "${hidumper_frameworks_path}/src/common/dumper_parameter.cpp", "${hidumper_frameworks_path}/src/common/option_args.cpp", "${hidumper_frameworks_path}/src/executor/memory/dma_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/get_cma_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/get_hardware_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/get_heap_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/get_kernel_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/get_process_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/get_ram_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/memory_filter.cpp", "${hidumper_frameworks_path}/src/executor/memory/memory_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/memory_info_wrapper.cpp", "${hidumper_frameworks_path}/src/executor/memory/memory_util.cpp", "${hidumper_frameworks_path}/src/executor/memory/parse/parse_meminfo.cpp", "${hidumper_frameworks_path}/src/executor/memory/parse/parse_smaps_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/parse/parse_smaps_rollup_info.cpp", "${hidumper_frameworks_path}/src/executor/memory/parse/parse_vmallocinfo.cpp", "${hidumper_frameworks_path}/src/executor/memory/smaps_memory_info.cpp", "${hidumper_frameworks_path}/src/util/config_data.cpp", "${hidumper_frameworks_path}/src/util/config_utils.cpp", "${hidumper_frameworks_path}/src/util/file_utils.cpp", "${hidumper_frameworks_path}/src/util/string_utils.cpp", "native/src/dump_common_utils.cpp", ] configs = [ "${hidumper_utils_path}:utils_config", ":interface_include", "${hidumper_frameworks_path}:hidumper_include", "${hidumper_service_path}:service_config", ] deps = [ "${hidumper_utils_path}:utils" ] external_deps = [ "c_utils:utils", "drivers_interface_memorytracker:libmemorytracker_proxy_1.0", "eventhandler:libeventhandler", "hdf_core:libhdf_utils", "hilog:libhilog", "hiview:libucollection_graphic", "hiview:libucollection_utility", "init:libbegetutil", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [] if (hidumper_ability_runtime_enable) { external_deps += [ "ability_runtime:app_manager" ] defines += [ "HIDUMPER_ABILITY_RUNTIME_ENABLE" ] } if (hidumper_report_memmgr) { external_deps += [ "memmgr:memmgrclient" ] defines += [ "HIDUMPER_MEMMGR_ENABLE" ] } subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } ohos_shared_library("hidumpermemory") { deps = [ ":hidumpermemory_source" ] external_deps = [ "hilog:libhilog" ] install_enable = true version_script = "hidumper.map" subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } if (hidumper_hiviewdfx_hiview_enable) { ohos_shared_library("hidumpercpuservice") { deps = [ ":hidumperservice_cpu_source" ] external_deps = [ "hilog:libhilog" ] install_enable = true version_script = "hidumper.map" shlib_type = "sa" subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } } ############################################################################ ohos_prebuilt_etc("hidumper_service.rc") { source = "native/etc/hidumper_service.cfg" relative_install_dir = "init" subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" } ohos_prebuilt_etc("infos_config") { source = "native/etc/infos_config.json" relative_install_dir = "hidumper" subsystem_name = "${hidumper_subsystem_name}" part_name = "${hidumper_part_name}" }