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("ftrace.gni") 17 18ohos_source_set("ftrace_plugin_source") { 19 sources = [ 20 "src/file_utils.cpp", 21 "src/flow_controller.cpp", 22 "src/ftrace_data_reader.cpp", 23 "src/ftrace_field_parser.cpp", 24 "src/ftrace_fs_ops.cpp", 25 "src/ftrace_module.cpp", 26 "src/ftrace_parser.cpp", 27 "src/hitrace_ops.cpp", 28 "src/kernel_symbols_parser.cpp", 29 "src/paged_mem_pool.cpp", 30 "src/printk_formats_parser.cpp", 31 "src/process_utils.cpp", 32 "src/result_transporter.cpp", 33 "src/string_utils.cpp", 34 "src/trace_ops.cpp", 35 ] 36 defines = [ "_GNU_SOURCE" ] 37 include_dirs = [ 38 "include", 39 "src", 40 "../../base/include", 41 "../api/include", 42 "${OHOS_PROFILER_DIR}/interfaces/kits", 43 "${OHOS_PROFILER_DIR}/device/base/include", 44 "//third_party/bounds_checking_function/include", 45 "//commonlibrary/c_utils/base/include", 46 ] 47 deps = [ 48 "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", 49 "${OHOS_PROFILER_DIR}/proto_encoder:proto_encoder_source", 50 "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_cpp", 51 "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_encoder", 52 "tools/device_kernel_version/${device_kernel_version}/event_parsers:ftrace_event_parsers", 53 "//third_party/bounds_checking_function:libsec_static", 54 ] 55 if (current_toolchain != host_toolchain) { 56 defines += [ "HAVE_HILOG" ] 57 external_deps = [ 58 "hilog:libhilog", 59 "hiview:libucollection_client", 60 ] 61 } 62 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 63 part_name = "${OHOS_PROFILER_PART_NAME}" 64 public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ] 65} 66 67ohos_shared_library("ftrace_plugin") { 68 deps = [ ":ftrace_plugin_source" ] 69 if (current_toolchain != host_toolchain) { 70 defines = [ "HAVE_HILOG" ] 71 external_deps = [ 72 "hilog:libhilog", 73 "hiview:libucollection_client", 74 ] 75 } 76 install_enable = true 77 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 78 part_name = "${OHOS_PROFILER_PART_NAME}" 79} 80 81group("ftrace_targets") { 82 deps = [ 83 ":ftrace_plugin", 84 "test:busy_test", 85 "test:get_tzinfo", 86 ] 87} 88