• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) Huawei Technologies Co., Ltd. 2023. 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.
13import("//build/ohos.gni")
14import("../../../build/ts.gni")
15ohos_source_set("pbreader_parser_src") {
16  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
17  part_name = "${OHOS_PROFILER_PART_NAME}"
18  sources = [
19    "../parser_base.cpp",
20    "pbreader_clock_detail_parser.cpp",
21    "pbreader_parser.cpp",
22  ]
23  include_dirs = [
24    "../../proto_reader/include",
25    ".",
26    "htrace_parser",
27    "../../include",
28    "../../",
29    "../",
30    "../../trace_data",
31    "../../cfg",
32    "../../trace_streamer",
33    "../../metrics",
34    "${THIRD_PARTY}/bounds_checking_function/include",
35    "${THIRD_PARTY}/protobuf/src",
36    "${THIRD_PARTY}/sqlite/include",
37    "${THIRD_PARTY}/json/single_include/nlohmann",
38    "../../filter",
39    "../../base",
40    "../../rpc",
41    "../ebpf_parser",
42  ]
43  include_dirs += [
44    "${SRC}/trace_data/trace_stdtype",
45    "${SRC}/trace_data/trace_stdtype/ftrace",
46    "${SRC}/trace_data/trace_stdtype/ftrace/template",
47    "${SRC}/trace_data/trace_stdtype/hilog",
48    "${SRC}/trace_data/trace_stdtype/hiperf",
49    "${SRC}/trace_data/trace_stdtype/hisysevent",
50    "${SRC}/trace_data/trace_stdtype/htrace",
51    "${SRC}/trace_data/trace_stdtype/measure",
52    "${SRC}/trace_data/trace_stdtype/xpower",
53  ]
54  if (is_mingw || is_mac) {
55    include_dirs += [
56      "${THIRD_PARTY}/elfutils/libelf",
57      "${THIRD_PARTY}/libbpf/include/uapi",
58    ]
59  }
60
61  if (!is_independent_compile) {
62    configs = [ "${TS_DIR}/gn:ts_config" ]
63  }
64  if (enable_ts_utest && !use_wasm) {
65    cflags = [
66      "-fprofile-arcs",
67      "-ftest-coverage",
68    ]
69    ldflags = [
70      "-fprofile-arcs",
71      "-ftest-coverage",
72      "--coverage",
73    ]
74    if (is_test) {
75      cflags += [ "-D IS_UT" ]
76    }
77  }
78  public_deps =
79      [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp" ]
80  if (enable_ebpf) {
81    public_deps += [ "../ebpf_parser:ebpf_parser" ]
82  }
83  if (enable_hiperf) {
84    public_deps += [ "../hiperf_parser:hiperf_parser" ]
85  }
86  if (enable_native_hook) {
87    public_deps += [ "native_hook_parser:native_hook_parser" ]
88  }
89  if (enable_hilog) {
90    public_deps += [ "hilog_parser:pbreader_hilog_parser" ]
91  }
92  if (enable_hisysevent) {
93    public_deps += [ "hisysevent_parser:pbreader_hisysevent_parser" ]
94  }
95  if (enable_arkts) {
96    public_deps += [ "arkts:pbreader_arkts_parser" ]
97  }
98  if (enable_htrace) {
99    public_deps += [ "htrace_parser:pbreader_htrace_parser" ]
100  }
101  if (enable_ffrt) {
102    public_deps += [ "ffrt_parser:pbreader_ffrt_parser" ]
103  }
104  if (enable_memory) {
105    public_deps += [ "mem_parser:pbreader_mem_parser" ]
106  }
107  if (enable_xpower) {
108    public_deps += [ "xpower_parser:pbreader_xpower_parser" ]
109  }
110  if (enable_hidump) {
111    public_deps += [ "hidump_parser:pbreader_hidump_parser" ]
112  }
113  if (enable_cpudata) {
114    public_deps += [ "cpu_data_parser:cpu_data_parser" ]
115  }
116  if (enable_network) {
117    public_deps += [ "network_parser:network_parser" ]
118  }
119  if (enable_diskio) {
120    public_deps += [ "disk_io_parser:disk_io_parser" ]
121  }
122  if (enable_process) {
123    public_deps += [ "process_parser:process_parser" ]
124  }
125  if (enable_stream_extend) {
126    public_deps +=
127        [ "${EXTEND_SRC}/parser/pbreader_stream_parser:stream_extend_parser" ]
128  }
129  public_deps += [
130    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp_standard",
131    "${THIRD_PARTY}/protobuf:protobuf_lite_static",
132    "${THIRD_PARTY}/protobuf:protobuf_static",
133    "${THIRD_PARTY}/zlib:libz",
134    "//third_party/perf_include/hiviewdfx:libfaultloggerd",
135  ]
136}
137