1# Copyright (C) 2021 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. 13 14import("//build/ohos.gni") 15import("../base/config.gni") 16import("../plugins/ftrace_plugin/ftrace.gni") 17 18ohos_source_set("command_line") { 19 part_name = "profiler" 20 sources = [ 21 "src/command_line.cpp", 22 "src/command_param.cpp", 23 "src/command_param_switch.cpp", 24 "src/command_param_text.cpp", 25 ] 26 include_dirs = [ "include" ] 27} 28ohos_executable("hiprofiler_cmd") { 29 sources = [ 30 "src/main.cpp", 31 "src/parse_plugin_config.cpp", 32 ] 33 include_dirs = [ "include" ] 34 deps = [ 35 ":command_line", 36 "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", 37 "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", 38 "${OHOS_PROFILER_DIR}/device/base:hiprofiler_base", 39 "${OHOS_PROFILER_DIR}/protos/services:profiler_service_proto", 40 "${OHOS_PROFILER_DIR}/protos/services:profiler_service_type_source", 41 "${OHOS_PROFILER_DIR}/protos/types/plugins/cpu_data:cpu_plugin_config_cpp_standard", 42 "${OHOS_PROFILER_DIR}/protos/types/plugins/diskio_data:diskio_plugin_config_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/hidump_data:hidump_plugin_config_cpp_standard", 45 "${OHOS_PROFILER_DIR}/protos/types/plugins/hilog_data:hilog_plugin_config_cpp_standard", 46 "${OHOS_PROFILER_DIR}/protos/types/plugins/hiperf_data:hiperf_data_cpp_standard", 47 "${OHOS_PROFILER_DIR}/protos/types/plugins/hisysevent_data:hisysevent_plugin_config_cpp_standard", 48 "${OHOS_PROFILER_DIR}/protos/types/plugins/memory_data:memory_plugin_config_cpp_standard", 49 "${OHOS_PROFILER_DIR}/protos/types/plugins/native_hook:native_hook_plugin_config_cpp_standard", 50 "${OHOS_PROFILER_DIR}/protos/types/plugins/network_data:network_plugin_config_cpp_standard", 51 "${OHOS_PROFILER_DIR}/protos/types/plugins/process_data:process_plugin_config_cpp_standard", 52 ] 53 external_deps = [ "init:libbegetutil" ] 54 install_enable = true 55 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 56 part_name = "${OHOS_PROFILER_PART_NAME}" 57} 58