1# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. 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("//build/ohos.gni") 15import("../base/config.gni") 16import("../plugins/ftrace_plugin/ftrace.gni") 17 18ohos_source_set("command_line") { 19 part_name = "${OHOS_PROFILER_PART_NAME}" 20 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 21 sources = [ 22 "src/command_line.cpp", 23 "src/command_param.cpp", 24 "src/command_param_switch.cpp", 25 "src/command_param_text.cpp", 26 ] 27 include_dirs = [ "include" ] 28} 29ohos_executable("hiprofiler_cmd") { 30 sources = [ 31 "src/main.cpp", 32 "src/parse_plugin_config.cpp", 33 ] 34 include_dirs = [ "include" ] 35 deps = [ 36 ":command_line", 37 "${OHOS_PROFILER_DIR}/device/base:hiprofiler_base", 38 "${OHOS_PROFILER_DIR}/protos/services:profiler_service_proto", 39 "${OHOS_PROFILER_DIR}/protos/services:profiler_service_type_source", 40 "${OHOS_PROFILER_DIR}/protos/types/plugins/cpu_data:cpu_plugin_config_cpp_standard", 41 "${OHOS_PROFILER_DIR}/protos/types/plugins/diskio_data:diskio_plugin_config_cpp_standard", 42 "${OHOS_PROFILER_DIR}/protos/types/plugins/ffrt_profiler:ffrt_profiler_cpp_standard", 43 "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_plugin_config_cpp_standard", 44 "${OHOS_PROFILER_DIR}/protos/types/plugins/gpu_data:gpu_plugin_config_cpp_standard", 45 "${OHOS_PROFILER_DIR}/protos/types/plugins/hidump_data:hidump_plugin_config_cpp_standard", 46 "${OHOS_PROFILER_DIR}/protos/types/plugins/hiebpf_data:hiebpf_data_cpp_standard", 47 "${OHOS_PROFILER_DIR}/protos/types/plugins/hilog_data:hilog_plugin_config_cpp_standard", 48 "${OHOS_PROFILER_DIR}/protos/types/plugins/hiperf_data:hiperf_data_cpp_standard", 49 "${OHOS_PROFILER_DIR}/protos/types/plugins/hisysevent_data:hisysevent_plugin_config_cpp_standard", 50 "${OHOS_PROFILER_DIR}/protos/types/plugins/memory_data:memory_plugin_config_cpp_standard", 51 "${OHOS_PROFILER_DIR}/protos/types/plugins/native_hook:native_hook_plugin_config_cpp_standard", 52 "${OHOS_PROFILER_DIR}/protos/types/plugins/network_data:network_plugin_config_cpp_standard", 53 "${OHOS_PROFILER_DIR}/protos/types/plugins/network_profiler:network_profiler_cpp_standard", 54 "${OHOS_PROFILER_DIR}/protos/types/plugins/process_data:process_plugin_config_cpp_standard", 55 "${OHOS_PROFILER_DIR}/protos/types/plugins/xpower_data:xpower_plugin_config_cpp_standard", 56 ] 57 external_deps = [ 58 "abseil-cpp:absl_cord", 59 "abseil-cpp:absl_log", 60 "abseil-cpp:absl_sync", 61 "grpc:grpc", 62 "grpc:grpcxx", 63 "grpc:gpr", 64 "init:libbegetutil", 65 "protobuf:protobuf", 66 ] 67 if (current_toolchain != host_toolchain) { 68 defines = [ "HAVE_HILOG" ] 69 external_deps += [ "hilog:libhilog_base" ] 70 } 71 install_enable = true 72 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 73 part_name = "${OHOS_PROFILER_PART_NAME}" 74} 75