• 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("hiperf_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  if (enable_ts_utest && !use_wasm) {
23    cflags = [
24      "-fprofile-arcs",
25      "-ftest-coverage",
26    ]
27    ldflags = [
28      "-fprofile-arcs",
29      "-ftest-coverage",
30      "--coverage",
31    ]
32    if (is_test) {
33      cflags += [ "-D IS_UT" ]
34    }
35  }
36  sources = [ "perf_data_parser.cpp" ]
37  include_dirs = [
38    ".",
39    "../../base",
40    "../../cfg",
41    "../../include",
42    "../../",
43    "../../filter",
44    "../../trace_data",
45    "..",
46    "../../trace_streamer",
47    "../../proto_reader/include",
48    "${THIRD_PARTY}/bounds_checking_function/include",
49    "${PERF_DIR}/hiperf/include/nonlinux/linux",
50    "${PERF_DIR}/hiperf/include/nonlinux",
51    "${PERF_DIR}/hiperf/include",
52    "${THIRD_PARTY}/sqlite/include",
53    "${THIRD_PARTY}/protobuf/src",
54    "${THIRD_PARTY}/perf_include",
55    "${THIRD_PARTY}/perf_include/libbpf",
56    "${COMMON_LIBRARY}/c_utils/base/include",
57    "${THIRD_PARTY}/googletest/googletest/include",
58  ]
59  include_dirs += [
60    "${THIRD_PARTY}/perf_include/hiviewdfx/hilog/include",
61    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/common/dfxlog",
62    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/common/dfxutil",
63    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/common",
64    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/nonlinux",
65    "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/include",
66  ]
67  include_dirs += [
68    "${SRC}/trace_data/trace_stdtype",
69    "${SRC}/trace_data/trace_stdtype/ftrace",
70    "${SRC}/trace_data/trace_stdtype/ftrace/template",
71    "${SRC}/trace_data/trace_stdtype/hilog",
72    "${SRC}/trace_data/trace_stdtype/hiperf",
73    "${SRC}/trace_data/trace_stdtype/hisysevent",
74    "${SRC}/trace_data/trace_stdtype/htrace",
75    "${SRC}/trace_data/trace_stdtype/measure",
76  ]
77  include_dirs += [ "${THIRD_PARTY}/libunwind/include" ]
78  if (is_mingw || is_mac) {
79    include_dirs += [ "${THIRD_PARTY}/libbpf/include/uapi" ]
80  }
81  if (is_mingw) {
82    cflags = [ "-includeMingW64Fix.h" ]
83  }
84}
85
86group("hiperf_parser") {
87  deps = [
88    ":hiperf_parser_src",
89    "${PERF_DIR}/hiperf:hiperf_platform_common",
90    "${THIRD_PARTY}/protobuf:protobuf_lite_static",
91    "${THIRD_PARTY}/protobuf:protobuf_static",
92    "//third_party/perf_include/hiviewdfx:hiviewdfx",
93  ]
94}
95