• 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("../../../build/ts.gni")
16ohos_source_set("ebpf_parser_src") {
17  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
18  part_name = "${OHOS_PROFILER_PART_NAME}"
19  if (!is_independent_compile) {
20    configs = [ "${TS_DIR}/gn:ts_config" ]
21  }
22  sources = [
23    "bio_latency_data_parser.cpp",
24    "ebpf_base.cpp",
25    "ebpf_data_parser.cpp",
26    "ebpf_data_reader.cpp",
27    "ebpf_splitter.cpp",
28    "file_system_data_parser.cpp",
29    "paged_memory_data_parser.cpp",
30  ]
31  include_dirs = [
32    ".",
33    "../",
34    "../..",
35    "../../trace_data",
36    "../../base",
37    "../../include",
38    "../../filter",
39    "../../cfg",
40    "../../trace_streamer",
41    "../../proto_reader/include",
42    "${THIRD_PARTY}/protobuf/src",
43    "${THIRD_PARTY}/sqlite/include",
44    "${THIRD_PARTY}/bounds_checking_function/include",
45  ]
46  include_dirs += [
47    "${SRC}/trace_data/trace_stdtype",
48    "${SRC}/trace_data/trace_stdtype/ftrace",
49    "${SRC}/trace_data/trace_stdtype/ftrace/template",
50    "${SRC}/trace_data/trace_stdtype/hilog",
51    "${SRC}/trace_data/trace_stdtype/hiperf",
52    "${SRC}/trace_data/trace_stdtype/hisysevent",
53    "${SRC}/trace_data/trace_stdtype/htrace",
54    "${SRC}/trace_data/trace_stdtype/measure",
55  ]
56  if (is_mingw || is_mac) {
57    include_dirs += [ "${THIRD_PARTY}/elfutils/libelf" ]
58  }
59  if (enable_ts_utest && !use_wasm) {
60    cflags = [
61      "-fprofile-arcs",
62      "-ftest-coverage",
63    ]
64    ldflags = [
65      "-fprofile-arcs",
66      "-ftest-coverage",
67      "--coverage",
68    ]
69    if (is_test) {
70      cflags += [ "-D IS_UT" ]
71    }
72  }
73  public_deps = [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader" ]
74  include_dirs += [
75    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/nonlinux",
76    "${THIRD_PARTY}/perf_include/linux",
77    "${THIRD_PARTY}/hiperf/include",
78    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/include",
79    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/common",
80    "${THIRD_PARTY}/hiperf/include/nonlinux/linux",
81    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/common/dfxutil",
82    "${THIRD_PARTY}/hiperf/include/nonlinux/",
83    "${THIRD_PARTY}/perf_include/libbpf",
84  ]
85}
86
87group("ebpf_parser") {
88  deps = [
89    ":ebpf_parser_src",
90    "${THIRD_PARTY}/protobuf:protobuf_lite_static",
91    "${THIRD_PARTY}/protobuf:protobuf_static",
92  ]
93}
94