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. 13 14import("//build/ohos.gni") 15import("../../build/ts.gni") 16 17config("parser_base_cfg") { 18 include_dirs = [ 19 "${THIRD_PARTY}/protobuf/src", 20 "${THIRD_PARTY}/sqlite/include", 21 "${SRC}/base", 22 "${SRC}/cfg", 23 "${SRC}/trace_streamer", 24 "${SRC}/trace_data", 25 "${SRC}/include", 26 "${SRC}/filter", 27 "${SRC}/filter/hi_sysevent_filter", 28 "${SRC}/filter/hook_filter", 29 "${SRC}/filter/perf_filter", 30 "${SRC}", 31 ".", 32 "ptreader_parser", 33 "pbreader_parser", 34 "pbreader_parser/htrace_parser", 35 "rawtrace_parser", 36 "ebpf_parser", 37 "../proto_reader/include", 38 "${THIRD_PARTY}/bounds_checking_function/include", 39 "${THIRD_PARTY}/json/single_include/nlohmann", 40 "${THIRD_PARTY}/profiler/device/plugins/ftrace_plugin/include", 41 ] 42 include_dirs += [ 43 "${SRC}/trace_data/trace_stdtype", 44 "${SRC}/trace_data/trace_stdtype/ftrace", 45 "${SRC}/trace_data/trace_stdtype/ftrace/template", 46 "${SRC}/trace_data/trace_stdtype/hilog", 47 "${SRC}/trace_data/trace_stdtype/hiperf", 48 "${SRC}/trace_data/trace_stdtype/hisysevent", 49 "${SRC}/trace_data/trace_stdtype/htrace", 50 "${SRC}/trace_data/trace_stdtype/measure", 51 "${SRC}/trace_data/trace_stdtype/xpower", 52 ] 53 if (!is_independent_compile) { 54 configs = [ "${TS_DIR}/gn:ts_config" ] 55 } 56 if (enable_ts_utest && !use_wasm) { 57 cflags = [ 58 "-fprofile-arcs", 59 "-ftest-coverage", 60 ] 61 ldflags = [ 62 "-fprofile-arcs", 63 "-ftest-coverage", 64 "--coverage", 65 ] 66 if (is_test) { 67 cflags += [ "-D IS_UT" ] 68 } 69 } 70} 71 72config("hilog_parser_cfg") { 73 include_dirs = [ 74 "pbreader_parser", 75 "pbreader_parser/hilog_parser", 76 "ptreader_parser/hilog_parser", 77 ] 78} 79 80config("hisysevent_parser_cfg") { 81 include_dirs = [ 82 "pbreader_parser", 83 "pbreader_parser/hisysevent_parser", 84 "ptreader_parser/hisysevent_parser", 85 "${SRC}/filter/hi_sysevent_filter", 86 ] 87} 88 89ohos_source_set("parser") { 90 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 91 part_name = "${OHOS_PROFILER_PART_NAME}" 92 sources = [ 93 "event_parser_base.cpp", 94 "print_event_parser.cpp", 95 "thread_state_flag.cpp", 96 ] 97 98 public_deps = [] 99 public_deps += [ "pbreader_parser:pbreader_parser_src" ] 100 public_deps += [ "ptreader_parser:ptreader_parser_src" ] 101 if (enable_rawtrace) { 102 public_deps += [ "rawtrace_parser:rawtrace_parser" ] 103 } 104 if (enable_ebpf) { 105 public_deps += [ "ebpf_parser:ebpf_parser" ] 106 } 107 public_configs = [ ":parser_base_cfg" ] 108} 109