106f6ba60Sopenharmony_ci# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. 206f6ba60Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 306f6ba60Sopenharmony_ci# you may not use this file except in compliance with the License. 406f6ba60Sopenharmony_ci# You may obtain a copy of the License at 506f6ba60Sopenharmony_ci# 606f6ba60Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 706f6ba60Sopenharmony_ci# 806f6ba60Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 906f6ba60Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 1006f6ba60Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1106f6ba60Sopenharmony_ci# See the License for the specific language governing permissions and 1206f6ba60Sopenharmony_ci# limitations under the License. 1306f6ba60Sopenharmony_ci 1406f6ba60Sopenharmony_ciimport("//build/ohos.gni") 1506f6ba60Sopenharmony_ciimport("../base/config.gni") 1606f6ba60Sopenharmony_ciimport("../plugins/ftrace_plugin/ftrace.gni") 1706f6ba60Sopenharmony_ci 1806f6ba60Sopenharmony_ciohos_source_set("command_line") { 1906f6ba60Sopenharmony_ci part_name = "${OHOS_PROFILER_PART_NAME}" 2006f6ba60Sopenharmony_ci subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 2106f6ba60Sopenharmony_ci sources = [ 2206f6ba60Sopenharmony_ci "src/command_line.cpp", 2306f6ba60Sopenharmony_ci "src/command_param.cpp", 2406f6ba60Sopenharmony_ci "src/command_param_switch.cpp", 2506f6ba60Sopenharmony_ci "src/command_param_text.cpp", 2606f6ba60Sopenharmony_ci ] 2706f6ba60Sopenharmony_ci include_dirs = [ "include" ] 2806f6ba60Sopenharmony_ci} 2906f6ba60Sopenharmony_ciohos_executable("hiprofiler_cmd") { 3006f6ba60Sopenharmony_ci sources = [ 3106f6ba60Sopenharmony_ci "src/main.cpp", 3206f6ba60Sopenharmony_ci "src/parse_plugin_config.cpp", 3306f6ba60Sopenharmony_ci ] 3406f6ba60Sopenharmony_ci include_dirs = [ "include" ] 3506f6ba60Sopenharmony_ci deps = [ 3606f6ba60Sopenharmony_ci ":command_line", 3706f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/device/base:hiprofiler_base", 3806f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/services:profiler_service_proto", 3906f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/services:profiler_service_type_source", 4006f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/cpu_data:cpu_plugin_config_cpp_standard", 4106f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/diskio_data:diskio_plugin_config_cpp_standard", 4206f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/ffrt_profiler:ffrt_profiler_cpp_standard", 4306f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_plugin_config_cpp_standard", 4406f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/gpu_data:gpu_plugin_config_cpp_standard", 4506f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/hidump_data:hidump_plugin_config_cpp_standard", 4606f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/hiebpf_data:hiebpf_data_cpp_standard", 4706f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/hilog_data:hilog_plugin_config_cpp_standard", 4806f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/hiperf_data:hiperf_data_cpp_standard", 4906f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/hisysevent_data:hisysevent_plugin_config_cpp_standard", 5006f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/memory_data:memory_plugin_config_cpp_standard", 5106f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/native_hook:native_hook_plugin_config_cpp_standard", 5206f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/network_data:network_plugin_config_cpp_standard", 5306f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/network_profiler:network_profiler_cpp_standard", 5406f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/process_data:process_plugin_config_cpp_standard", 5506f6ba60Sopenharmony_ci "${OHOS_PROFILER_DIR}/protos/types/plugins/xpower_data:xpower_plugin_config_cpp_standard", 5606f6ba60Sopenharmony_ci ] 5706f6ba60Sopenharmony_ci external_deps = [ 5806f6ba60Sopenharmony_ci "abseil-cpp:absl_sync", 5906f6ba60Sopenharmony_ci "grpc:grpc", 6006f6ba60Sopenharmony_ci "grpc:grpcxx", 6106f6ba60Sopenharmony_ci "init:libbegetutil", 6206f6ba60Sopenharmony_ci "protobuf:protobuf_lite", 6306f6ba60Sopenharmony_ci ] 6406f6ba60Sopenharmony_ci if (current_toolchain != host_toolchain) { 6506f6ba60Sopenharmony_ci defines = [ "HAVE_HILOG" ] 6606f6ba60Sopenharmony_ci external_deps += [ "hilog:libhilog_base" ] 6706f6ba60Sopenharmony_ci } 6806f6ba60Sopenharmony_ci install_enable = true 6906f6ba60Sopenharmony_ci subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 7006f6ba60Sopenharmony_ci part_name = "${OHOS_PROFILER_PART_NAME}" 7106f6ba60Sopenharmony_ci} 72