# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
import("../../base/config.gni")
import("ftrace.gni")
ohos_source_set("ftrace_plugin_source") {
branch_protector_ret = "pac_ret"
configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_size_opt_config" ]
sources = [
"src/file_utils.cpp",
"src/flow_controller.cpp",
"src/ftrace_data_reader.cpp",
"src/ftrace_field_parser.cpp",
"src/ftrace_fs_ops.cpp",
"src/ftrace_module.cpp",
"src/ftrace_parser.cpp",
"src/kernel_symbols_parser.cpp",
"src/paged_mem_pool.cpp",
"src/printk_formats_parser.cpp",
"src/result_transporter.cpp",
"src/string_utils.cpp",
]
defines = [ "_GNU_SOURCE" ]
include_dirs = [
"include",
"src",
"../../base/include",
"../api/include",
"${OHOS_PROFILER_DIR}/interfaces/kits",
"${OHOS_PROFILER_DIR}/device/base/include",
]
deps = [
"${OHOS_PROFILER_DIR}/device/base:libhiprofiler_base",
"${OHOS_PROFILER_DIR}/proto_encoder:proto_encoder_source",
"${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_cpp",
"${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_encoder",
"tools/device_kernel_version/${device_kernel_version}/event_parsers:ftrace_event_parsers",
]
if (current_toolchain != host_toolchain) {
defines += [ "HAVE_HILOG" ]
external_deps = [
"bounds_checking_function:libsec_shared",
"c_utils:utils",
"hisysevent:libhisysevent",
"hiview:libucollection_client",
"init:libbegetutil",
"protobuf:protobuf_lite",
]
}
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
part_name = "${OHOS_PROFILER_PART_NAME}"
public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
}
ohos_shared_library("ftrace_plugin") {
branch_protector_ret = "pac_ret"
configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_size_opt_config" ]
deps = [ ":ftrace_plugin_source" ]
version_script = "libftrace_plugin.map"
if (current_toolchain != host_toolchain) {
defines = [ "HAVE_HILOG" ]
external_deps = [
"bounds_checking_function:libsec_shared",
"hiview:libucollection_client",
"init:libbegetutil",
]
}
install_enable = true
subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
part_name = "${OHOS_PROFILER_PART_NAME}"
}
group("ftrace_targets") {
deps = [ ":ftrace_plugin" ]
}
group("ftrace_debug_targets") {
testonly = true
deps = [
"test:busy_test",
"test:get_tzinfo",
]
}