• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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")
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/sub_event_parser.cpp",
35    "src/trace_ops.cpp",
36  ]
37  defines = [ "_GNU_SOURCE" ]
38  include_dirs = [
39    "include",
40    "src",
41    "../../base/include",
42    "../api/include",
43    "${OHOS_PROFILER_DIR}/interfaces/kits",
44    "${OHOS_PROFILER_DIR}/device/base/include",
45    "//third_party/bounds_checking_function/include",
46    "//commonlibrary/c_utils/base/include",
47  ]
48  deps = [
49    "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite",
50    "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_cpp",
51    "tools/device_kernel_version/${device_kernel_version}/event_parsers:ftrace_event_parsers",
52    "//third_party/bounds_checking_function:libsec_static",
53  ]
54  if (current_toolchain != host_toolchain) {
55    defines += [ "HAVE_HILOG" ]
56    if (build_l2) {
57      external_deps = [ "shared_library:libhilog" ]
58    } else {
59      external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
60    }
61  }
62  public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
63}
64
65ohos_shared_library("ftrace_plugin") {
66  deps = [ ":ftrace_plugin_source" ]
67  install_enable = true
68  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
69  part_name = "${OHOS_PROFILER_PART_NAME}"
70}
71
72group("ftrace_targets") {
73  deps = [
74    ":ftrace_plugin",
75    "test:busy_test",
76    "test:get_tzinfo",
77  ]
78}
79