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