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