• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/kernel_symbols_parser.cpp",
28    "src/paged_mem_pool.cpp",
29    "src/printk_formats_parser.cpp",
30    "src/result_transporter.cpp",
31    "src/string_utils.cpp",
32  ]
33  defines = [ "_GNU_SOURCE" ]
34  include_dirs = [
35    "include",
36    "src",
37    "../../base/include",
38    "../api/include",
39    "${OHOS_PROFILER_DIR}/interfaces/kits",
40    "${OHOS_PROFILER_DIR}/device/base/include",
41  ]
42  deps = [
43    "${OHOS_PROFILER_DIR}/device/base:hiprofiler_base",
44    "${OHOS_PROFILER_DIR}/proto_encoder:proto_encoder_source",
45    "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_cpp",
46    "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_encoder",
47    "../../base:hiprofiler_base",
48    "tools/device_kernel_version/${device_kernel_version}/event_parsers:ftrace_event_parsers",
49  ]
50  if (current_toolchain != host_toolchain) {
51    defines += [ "HAVE_HILOG" ]
52    external_deps = [
53      "bounds_checking_function:libsec_shared",
54      "c_utils:utils",
55      "hilog:libhilog_base",
56      "hisysevent:libhisysevent",
57      "hiview:libucollection_client",
58      "init:libbegetutil",
59      "protobuf:protobuf_lite",
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  version_script = "libftrace_plugin.map"
70  if (current_toolchain != host_toolchain) {
71    defines = [ "HAVE_HILOG" ]
72    external_deps = [
73      "bounds_checking_function:libsec_shared",
74      "hilog:libhilog_base",
75      "hiview:libucollection_client",
76      "init:libbegetutil",
77    ]
78  }
79  install_enable = true
80  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
81  part_name = "${OHOS_PROFILER_PART_NAME}"
82}
83
84group("ftrace_targets") {
85  deps = [
86    ":ftrace_plugin",
87    "test:busy_test",
88    "test:get_tzinfo",
89  ]
90}
91