• 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.
13import("//build/ohos.gni")
14import("../../ts.gni")
15ohos_source_set("htrace_parser_src") {
16  sources = [
17    "../parser_base.cpp",
18    "htrace_clock_detail_parser.cpp",
19    "htrace_clock_detail_parser.h",
20    "htrace_cpu_data_parser.cpp",
21    "htrace_cpu_data_parser.h",
22    "htrace_cpu_parser/htrace_cpu_detail_parser.cpp",
23    "htrace_cpu_parser/htrace_cpu_detail_parser.h",
24    "htrace_disk_io_parser.cpp",
25    "htrace_disk_io_parser.h",
26    "htrace_event_parser/htrace_event_parser.cpp",
27    "htrace_event_parser/htrace_event_parser.h",
28    "htrace_file_header.h",
29    "htrace_hidump_parser.cpp",
30    "htrace_hidump_parser.h",
31    "htrace_hilog_parser.cpp",
32    "htrace_hilog_parser.h",
33    "htrace_hisysevent_parser.cpp",
34    "htrace_hisysevent_parser.h",
35    "htrace_mem_parser.cpp",
36    "htrace_mem_parser.h",
37    "htrace_native_hook_parser.cpp",
38    "htrace_native_hook_parser.h",
39    "htrace_network_parser.cpp",
40    "htrace_network_parser.h",
41    "htrace_parser.cpp",
42    "htrace_plugin_time_parser.cpp",
43    "htrace_plugin_time_parser.h",
44    "htrace_process_parser.cpp",
45    "htrace_process_parser.h",
46    "htrace_symbols_detail_parser.cpp",
47    "htrace_symbols_detail_parser.h",
48  ]
49  include_dirs = [
50    ".",
51    "htrace_event_parser",
52    "htrace_cpu_parser",
53    "${OHOS_PROTO_GEN}",
54    "${OHOS_PROTO_GEN}/types/plugins/memory_data",
55    "${OHOS_PROTO_GEN}/types/plugins/ftrace_data/${kernel_version}",
56    "${OHOS_PROTO_GEN}/types/plugins/hilog_data",
57    "${OHOS_PROTO_GEN}/types/plugins/native_hook",
58    "${OHOS_PROTO_GEN}/types/plugins/hidump_data",
59    "${OHOS_PROTO_GEN}/types/plugins/network_data",
60    "${OHOS_PROTO_GEN}/types/plugins/cpu_data",
61    "${OHOS_PROTO_GEN}/types/plugins/diskio_data",
62    "${OHOS_PROTO_GEN}/types/plugins/process_data",
63    "${OHOS_PROTO_GEN}/types/plugins/hisysevent_data",
64    "../../include",
65    "../../",
66    "../",
67    "../../trace_data",
68    "../../cfg",
69    "../../trace_streamer",
70    "//third_party/protobuf/src",
71    "//third_party/sqlite/include",
72    "//third_party/json-master/include",
73    "//third_party/json-master/include/nlohmann",
74    "../../filter",
75    "../../base",
76    "../ebpf_parser",
77  ]
78  include_dirs += [
79    "//third_party/libunwind/include",
80    "//third_party/libunwind/src",
81  ]
82  if (with_perf) {
83    include_dirs += [
84      "../hiperf_parser/hiperf/linux",
85      "../hiperf_parser/hiperf/include",
86      "../hiperf_parser/hiperf/kernel",
87      "//third_party/perf_include/include",
88      "//third_party/perf_include",
89      "//third_party/perf_include/linux",
90      "../hiperf_parser",
91      "../hiperf_parser/include",
92    ]
93  }
94  if (enable_ts_utest && !use_wasm) {
95    cflags = [
96      "-fprofile-arcs",
97      "-ftest-coverage",
98    ]
99    ldflags = [
100      "-fprofile-arcs",
101      "-ftest-coverage",
102      "--coverage",
103    ]
104  }
105  public_deps = []
106  deps = []
107}
108group("htrace_parser") {
109  deps = [
110    ":htrace_parser_src",
111    "//third_party/protobuf:protobuf",
112    "//third_party/protobuf:protobuf_lite",
113  ]
114  if (!use_wasm && !is_win && !is_macx && !is_test) {
115    deps += [ "//third_party/libunwind:libunwind" ]
116  }
117  if (target != "test" && !is_openharmony) {
118    deps += [ "//prebuilts/protos:ts_proto_data_cpp" ]
119  }
120}
121