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") 16 17ohos_shared_library("ftrace_plugin") { 18 sources = [ 19 "src/bytrace_ops.cpp", 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/kernel_symbols_parser.cpp", 28 "src/paged_mem_pool.cpp", 29 "src/printk_formats_parser.cpp", 30 "src/process_utils.cpp", 31 "src/result_transporter.cpp", 32 "src/string_utils.cpp", 33 "src/sub_event_parser.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 "//utils/native/base/include", 45 ] 46 deps = [ 47 "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", 48 "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data:ftrace_data_cpp", 49 "src/event_parsers:ftrace_event_parsers", 50 "//utils/native/base:utilsecurec", 51 ] 52 if (current_toolchain != host_toolchain) { 53 defines += [ "HAVE_HILOG" ] 54 if (build_l2) { 55 external_deps = [ "shared_library:libhilog" ] 56 } else { 57 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 58 } 59 } 60 public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ] 61 install_enable = true 62 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 63 part_name = "${OHOS_PROFILER_PART_NAME}" 64} 65 66group("ftrace_targets") { 67 deps = [ 68 ":ftrace_plugin", 69 "test:busy_test", 70 "test:get_tzinfo", 71 "tools/trace_converter", 72 ] 73} 74