• 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")
16
17config("hiprofiler_plugins_config") {
18  include_dirs = [
19    "./include",
20    "./src",
21    "../../base/include/",
22    "${OHOS_PROFILER_DIR}/device/services/ipc/include",
23    "${OHOS_PROFILER_DIR}/device/services/shared_memory/include",
24    "${OHOS_PROFILER_DIR}/interfaces/kits",
25  ]
26  cflags = [ "-pthread" ]
27  if (current_toolchain != host_toolchain) {
28    cflags += [ "-DHAVE_HILOG" ]
29  }
30}
31
32ohos_source_set("plugins_sources") {
33  part_name = "${OHOS_PROFILER_PART_NAME}"
34  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
35  include_dirs = [
36    "./include",
37    "../../base/include/",
38    "${OHOS_PROFILER_DIR}/interfaces/kits",
39  ]
40  sources = [
41    "src/buffer_writer.cpp",
42    "src/command_poller.cpp",
43    "src/plugin_manager.cpp",
44    "src/plugin_module.cpp",
45    "src/plugin_watcher.cpp",
46    "src/writer_adapter.cpp",
47  ]
48  public_deps = [
49    "${OHOS_PROFILER_DIR}/device/plugins/ffrt_profiler/service:ffrt_profiler_service",
50    "${OHOS_PROFILER_DIR}/device/plugins/network_profiler/service:network_profiler_service",
51    "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory_source",
52    "${OHOS_PROFILER_DIR}/proto_encoder:proto_encoder_source",
53    "${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto",
54    "${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source",
55    "../../base:hiprofiler_base",
56  ]
57  public_configs = [
58    ":hiprofiler_plugins_config",
59    "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config",
60  ]
61  if (current_toolchain != host_toolchain) {
62    external_deps = [
63      "bounds_checking_function:libsec_shared",
64      "c_utils:utils",
65      "hilog:libhilog_base",
66      "openssl:libcrypto_shared",
67      "protobuf:protobuf_lite",
68    ]
69  }
70  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
71}
72
73ohos_prebuilt_etc("hiprofiler_plugins.cfg") {
74  source = "../../etc/hiprofiler_plugins.cfg"
75  relative_install_dir = "init"
76  part_name = "${OHOS_PROFILER_PART_NAME}"
77  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
78}
79
80ohos_executable("hiprofiler_plugins") {
81  deps = [
82    ":hiprofiler_plugins.cfg",
83    ":plugins_sources",
84  ]
85  sources = [ "src/main.cpp" ]
86  if (current_toolchain != host_toolchain) {
87    defines = [ "HAVE_HILOG" ]
88    external_deps = [
89      "bounds_checking_function:libsec_shared",
90      "c_utils:utils",
91      "hilog:libhilog_base",
92      "openssl:libcrypto_shared",
93      "protobuf:protobuf_lite",
94    ]
95  }
96  install_enable = true
97  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
98  part_name = "${OHOS_PROFILER_PART_NAME}"
99}
100