• 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/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  ]
45  deps = [
46    "${OHOS_PROFILER_DIR}/device/base:hiprofiler_base",
47    "${OHOS_PROFILER_DIR}/proto_encoder:proto_encoder_source",
48    "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_cpp",
49    "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_encoder",
50    "tools/device_kernel_version/${device_kernel_version}/event_parsers:ftrace_event_parsers",
51  ]
52  if (current_toolchain != host_toolchain) {
53    defines += [ "HAVE_HILOG" ]
54    external_deps = [
55      "bounds_checking_function:libsec_shared",
56      "hilog:libhilog",
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      "hilog:libhilog",
74      "hiview:libucollection_client",
75      "init:libbegetutil",
76    ]
77  }
78  install_enable = true
79  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
80  part_name = "${OHOS_PROFILER_PART_NAME}"
81}
82
83group("ftrace_targets") {
84  deps = [
85    ":ftrace_plugin",
86    "test:busy_test",
87    "test:get_tzinfo",
88  ]
89}
90