• 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")
15
16config("rawtrace_parser_comm") {
17  include_dirs = [
18    "${SRC}",
19    "${SRC}/base",
20    "${SRC}/cfg",
21    "${SRC}/parser",
22    "${SRC}/trace_streamer",
23    "${SRC}/proto_reader/include",
24    "${SRC}/trace_data",
25    "${SRC}/filter",
26    "${SRC}/metrics",
27    "${THIRD_PARTY}/sqlite/include",
28    "${THIRD_PARTY}/bounds_checking_function/include",
29    "${THIRD_PARTY}/json/single_include/nlohmann",
30    "${PERF_DIR}/hiperf/include",
31    "${PERF_DIR}/hiperf/include/nonlinux/linux",
32    "${PERF_DIR}/hiperf/include/nonlinux",
33    "${PERF_DIR}/profiler/device/plugins/ftrace_plugin/include",
34    "${COMMON_LIBRARY}/c_utils/base/include",
35  ]
36  include_dirs += [
37    "${SRC}/trace_data/trace_stdtype",
38    "${SRC}/trace_data/trace_stdtype/ftrace",
39    "${SRC}/trace_data/trace_stdtype/ftrace/template",
40    "${SRC}/trace_data/trace_stdtype/hilog",
41    "${SRC}/trace_data/trace_stdtype/hiperf",
42    "${SRC}/trace_data/trace_stdtype/hisysevent",
43    "${SRC}/trace_data/trace_stdtype/htrace",
44    "${SRC}/trace_data/trace_stdtype/measure",
45  ]
46}
47
48ohos_source_set("rawtrace_parser_src") {
49  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
50  part_name = "${OHOS_PROFILER_PART_NAME}"
51  sources = [
52    "cpu_detail_parser.cpp",
53    "ftrace_event_processor.cpp",
54    "ftrace_field_processor.cpp",
55    "ftrace_processor.cpp",
56    "kernel_symbols_processor.cpp",
57    "printk_formats_processor.cpp",
58    "rawtrace_parser.cpp",
59  ]
60
61  public_configs = [ ":rawtrace_parser_comm" ]
62
63  if (!is_independent_compile) {
64    configs = [ "${TS_DIR}/gn:ts_config" ]
65  }
66  if (is_mingw) {
67    cflags = [ "-includeMingW64Fix.h" ]
68  }
69  if (enable_ts_utest && !use_wasm) {
70    cflags = [
71      "-fprofile-arcs",
72      "-ftest-coverage",
73    ]
74    ldflags = [
75      "-fprofile-arcs",
76      "-ftest-coverage",
77      "--coverage",
78    ]
79    if (is_test) {
80      cflags += [ "-D IS_UT" ]
81    }
82  }
83  public_deps = []
84  deps = [
85    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp_standard",
86    "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ts_ftrace_data_cpp",
87  ]
88}
89group("rawtrace_parser") {
90  deps = [
91    ":rawtrace_parser_src",
92    "${THIRD_PARTY}/protobuf:protobuf_lite_static",
93    "${THIRD_PARTY}/protobuf:protobuf_static",
94  ]
95}
96