• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 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")
16
17ohos_source_set("hiebpfplugin_source") {
18  sources = [ "src/hiebpf_module.cpp" ]
19  include_dirs = [
20    "include",
21    "${OHOS_PROFILER_DIR}/interfaces/kits",
22    "${OHOS_PROFILER_DIR}/device/base/include",
23    "//third_party/bounds_checking_function/include",
24    "//base/hiviewdfx/hilog/frameworks/native/include",
25  ]
26  deps = [
27    "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite",
28    "${OHOS_PROFILER_DIR}/protos/types/plugins/hiebpf_data:hiebpf_data_cpp",
29    "../../base:hiprofiler_base",
30    "//third_party/bounds_checking_function:libsec_static",
31  ]
32
33  if (current_toolchain != host_toolchain) {
34    defines = [ "HAVE_HILOG" ]
35    external_deps = [ "hilog:libhilog" ]
36  }
37  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
38  part_name = "${OHOS_PROFILER_PART_NAME}"
39  public_configs = [ "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config" ]
40}
41
42ohos_shared_library("hiebpfplugin") {
43  output_name = "hiebpfplugin"
44
45  deps = [ ":hiebpfplugin_source" ]
46  install_enable = true
47  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
48  part_name = "${OHOS_PROFILER_PART_NAME}"
49}
50
51group("ebpf_targets") {
52  deps = [
53    ":hiebpfplugin",
54    "tools:ebpf_converter",
55  ]
56  if (!use_libfuzzer) {
57    deps += [
58      "tools:ebpf_converter(${host_toolchain})",
59      "tools:ebpf_converter(//build/toolchain/mingw:mingw_x86_64)",
60    ]
61  }
62}
63