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 ] 44 if (enable_ts_utest && !use_wasm) { 45 cflags = [ 46 "-fprofile-arcs", 47 "-ftest-coverage", 48 ] 49 ldflags = [ 50 "-fprofile-arcs", 51 "-ftest-coverage", 52 "--coverage", 53 ] 54 if (is_test) { 55 cflags += [ "-D IS_UT" ] 56 } 57 } 58} 59 60ohos_static_library("rawtrace_parser") { 61 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 62 part_name = "${OHOS_PROFILER_PART_NAME}" 63 sources = [ 64 "cpu_detail_parser.cpp", 65 "ftrace_event_processor.cpp", 66 "ftrace_field_processor.cpp", 67 "ftrace_processor.cpp", 68 "kernel_symbols_processor.cpp", 69 "printk_formats_processor.cpp", 70 "rawtrace_parser.cpp", 71 ] 72 73 public_configs = [ ":rawtrace_parser_comm" ] 74 75 if (!is_independent_compile) { 76 configs = [ "${TS_DIR}/gn:ts_config" ] 77 } 78 79 public_deps = [ 80 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp_standard", 81 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ts_ftrace_data_cpp", 82 "${THIRD_PARTY}/protobuf:protobuf_lite_static", 83 "${THIRD_PARTY}/protobuf:protobuf_static", 84 ] 85} 86