• 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")
16
17ohos_source_set("parser") {
18  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
19  part_name = "${OHOS_PROFILER_PART_NAME}"
20  sources = [
21    "bytrace_parser/bytrace_event_parser.cpp",
22    "bytrace_parser/bytrace_hilog_parser.cpp",
23    "bytrace_parser/bytrace_hisysevent_parser.cpp",
24    "bytrace_parser/bytrace_parser.cpp",
25    "event_parser_base.cpp",
26    "print_event_parser.cpp",
27    "thread_state_flag.cpp",
28  ]
29  deps = [
30    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_reader",
31    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/diskio_data:diskio_data_reader",
32    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hidump_data:hidump_data_reader",
33    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_reader",
34    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_reader",
35    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/js_memory:js_memory_data_reader",
36    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader",
37    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_data_reader",
38    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/network_data:network_data_reader",
39    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/process_data:process_data_reader",
40    "ebpf_parser:ebpf_parser",
41  ]
42  deps += [ "htrace_pbreader_parser:htrace_pbreader_parser" ]
43  deps += [ "rawtrace_parser:rawtrace_parser" ]
44
45  include_dirs = [
46    "${THIRD_PARTY}/protobuf/src",
47    "${THIRD_PARTY}/sqlite/include",
48    "${SRC}/base",
49    "${SRC}/cfg",
50    "${SRC}/trace_streamer",
51    "${SRC}/trace_data",
52    "${SRC}/include",
53    "${SRC}/filter",
54    "${SRC}",
55    ".",
56    "htrace_pbreader_parser",
57    "rawtrace_parser",
58    "../proto_reader/include",
59    "${THIRD_PARTY}/bounds_checking_function/include",
60    "${THIRD_PARTY}/json/single_include/nlohmann",
61  ]
62  include_dirs += [
63    "${SRC}/trace_data/trace_stdtype",
64    "${SRC}/trace_data/trace_stdtype/ftrace",
65    "${SRC}/trace_data/trace_stdtype/ftrace/template",
66    "${SRC}/trace_data/trace_stdtype/hilog",
67    "${SRC}/trace_data/trace_stdtype/hiperf",
68    "${SRC}/trace_data/trace_stdtype/hisysevent",
69    "${SRC}/trace_data/trace_stdtype/htrace",
70    "${SRC}/trace_data/trace_stdtype/measure",
71  ]
72  if (!is_independent_compile) {
73    configs = [ "${TS_DIR}/gn:ts_config" ]
74  }
75  if (enable_ts_utest && !use_wasm) {
76    cflags = [
77      "-fprofile-arcs",
78      "-ftest-coverage",
79    ]
80    ldflags = [
81      "-fprofile-arcs",
82      "-ftest-coverage",
83      "--coverage",
84    ]
85    if (is_test) {
86      cflags += [ "-D IS_UT" ]
87    }
88  }
89}
90