# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. # 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("//build/ohos.gni") import("../../base/config.gni") config("profiler_service_config") { include_dirs = [ "../../plugins/api/include", "../plugin_service/include", "include", "src", "${OHOS_PROFILER_DIR}/device/services/ipc/include", "${OHOS_PROFILER_DIR}/device/base/include", "${OHOS_PROFILER_DIR}/interfaces/kits", ] if (current_toolchain != host_toolchain) { cflags = [ "-DHAVE_HILOG" ] } } ohos_source_set("profiler_service") { part_name = "${OHOS_PROFILER_PART_NAME}" subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" sources = [ "src/profiler_capability_manager.cpp", "src/profiler_data_repeater.cpp", "src/profiler_service.cpp", "src/trace_file_helper.cpp", "src/trace_file_reader.cpp", "src/trace_file_writer.cpp", ] public_deps = [ "${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source", "${OHOS_PROFILER_DIR}/protos/services:profiler_service_proto", "${OHOS_PROFILER_DIR}/protos/types/plugins/hiperf_data:hiperf_data_cpp", "${OHOS_PROFILER_DIR}/protos/types/plugins/native_hook:native_hook_cpp", ] public_configs = [ ":profiler_service_config", "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config", ] external_deps = [ "bounds_checking_function:libsec_shared", "grpc:grpc", "grpc:grpcxx", "openssl:libcrypto_shared", "protobuf:protobuf", "protobuf:protobuf_lite", ] if (current_toolchain != host_toolchain) { external_deps += [ "hilog:libhilog_base" ] } defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] } ohos_prebuilt_etc("hiprofilerd.cfg") { source = "../../etc/hiprofilerd.cfg" relative_install_dir = "init" part_name = "${OHOS_PROFILER_PART_NAME}" subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" } ohos_prebuilt_etc("hiprofiler.para") { source = "../../etc/hiprofiler.para" relative_install_dir = "param" part_name = "${OHOS_PROFILER_PART_NAME}" subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" } ohos_prebuilt_etc("hiprofiler.para.dac") { source = "../../etc/hiprofiler.para.dac" relative_install_dir = "param" part_name = "${OHOS_PROFILER_PART_NAME}" subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" } ohos_executable("hiprofilerd") { sources = [ "src/main.cpp" ] deps = [ ":hiprofiler.para", ":hiprofiler.para.dac", ":hiprofilerd.cfg", ":profiler_service", "../../base:hiprofiler_base", "../plugin_service:hiprofiler_plugin_service", ] if (current_toolchain != host_toolchain) { external_deps = [ "abseil-cpp:absl_sync", "bounds_checking_function:libsec_shared", "grpc:gpr", "grpc:grpc", "grpc:grpcxx", "hilog:libhilog_base", "openssl:libcrypto_shared", "protobuf:protobuf_lite", ] } install_enable = true subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" part_name = "${OHOS_PROFILER_PART_NAME}" }