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 ] 53 if (is_mingw || is_mac) { 54 include_dirs += [ 55 "${THIRD_PARTY}/elfutils/libelf", 56 "${THIRD_PARTY}/libbpf/include/uapi", 57 ] 58 } 59 60 if (!is_independent_compile) { 61 configs = [ "${TS_DIR}/gn:ts_config" ] 62 } 63 if (enable_ts_utest && !use_wasm) { 64 cflags = [ 65 "-fprofile-arcs", 66 "-ftest-coverage", 67 ] 68 ldflags = [ 69 "-fprofile-arcs", 70 "-ftest-coverage", 71 "--coverage", 72 ] 73 if (is_test) { 74 cflags += [ "-D IS_UT" ] 75 } 76 } 77 public_configs = [ "../ebpf_parser:ebpf_parser_cfg" ] 78 public_deps = 79 [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp" ] 80 if (enable_hiperf) { 81 public_deps += [ "../hiperf_parser:hiperf_parser" ] 82 } 83 if (enable_native_hook) { 84 public_deps += [ "native_hook_parser:native_hook_parser" ] 85 } 86 if (enable_hilog) { 87 public_deps += [ "hilog_parser:pbreader_hilog_parser" ] 88 } 89 if (enable_hisysevent) { 90 public_deps += [ "hisysevent_parser:pbreader_hisysevent_parser" ] 91 } 92 if (enable_arkts) { 93 public_deps += [ "arkts:pbreader_arkts_parser" ] 94 } 95 if (enable_htrace) { 96 public_deps += [ "htrace_parser:pbreader_htrace_parser" ] 97 } 98 if (enable_ffrt) { 99 public_deps += [ "ffrt_parser:pbreader_ffrt_parser" ] 100 } 101 if (enable_memory) { 102 public_deps += [ "mem_parser:pbreader_mem_parser" ] 103 } 104 if (enable_hidump) { 105 public_deps += [ "hidump_parser:pbreader_hidump_parser" ] 106 } 107 if (enable_cpudata) { 108 public_deps += [ "cpu_data_parser:cpu_data_parser" ] 109 } 110 if (enable_network) { 111 public_deps += [ "network_parser:network_parser" ] 112 } 113 if (enable_diskio) { 114 public_deps += [ "disk_io_parser:disk_io_parser" ] 115 } 116 if (enable_process) { 117 public_deps += [ "process_parser:process_parser" ] 118 } 119 if (enable_stream_extend) { 120 public_deps += 121 [ "${EXTEND_SRC}/parser/pbreader_stream_parser:stream_extend_parser" ] 122 } 123 public_deps += [ 124 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp_standard", 125 "${THIRD_PARTY}/protobuf:protobuf_lite_static", 126 "${THIRD_PARTY}/protobuf:protobuf_static", 127 "//third_party/perf_include/hiviewdfx:libfaultloggerd", 128 ] 129} 130