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}/hiperf/include", 32 "${PERF_DIR}/hiperf/include/nonlinux/linux", 33 "${PERF_DIR}/hiperf/include/nonlinux", 34 "${PERF_DIR}/profiler/device/plugins/ftrace_plugin/include", 35 "${COMMON_LIBRARY}/c_utils/base/include", 36 ] 37 include_dirs += [ 38 "${SRC}/trace_data/trace_stdtype", 39 "${SRC}/trace_data/trace_stdtype/ftrace", 40 "${SRC}/trace_data/trace_stdtype/ftrace/template", 41 "${SRC}/trace_data/trace_stdtype/hilog", 42 "${SRC}/trace_data/trace_stdtype/hiperf", 43 "${SRC}/trace_data/trace_stdtype/hisysevent", 44 "${SRC}/trace_data/trace_stdtype/htrace", 45 "${SRC}/trace_data/trace_stdtype/measure", 46 ] 47 if (enable_ts_utest && !use_wasm) { 48 cflags = [ 49 "-fprofile-arcs", 50 "-ftest-coverage", 51 ] 52 ldflags = [ 53 "-fprofile-arcs", 54 "-ftest-coverage", 55 "--coverage", 56 ] 57 if (is_test) { 58 cflags += [ "-D IS_UT" ] 59 } 60 } 61} 62 63ohos_static_library("rawtrace_parser") { 64 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 65 part_name = "${OHOS_PROFILER_PART_NAME}" 66 sources = [ 67 "cpu_detail_parser.cpp", 68 "ftrace_event_processor.cpp", 69 "ftrace_field_processor.cpp", 70 "ftrace_processor.cpp", 71 "kernel_symbols_processor.cpp", 72 "printk_formats_processor.cpp", 73 "rawtrace_parser.cpp", 74 ] 75 76 public_configs = [ ":rawtrace_parser_comm" ] 77 78 if (!is_independent_compile) { 79 configs = [ "${TS_DIR}/gn:ts_config" ] 80 } 81 if (is_mingw) { 82 cflags = [ "-includeMingW64Fix.h" ] 83 } 84 85 public_deps = [ 86 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp_standard", 87 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ts_ftrace_data_cpp", 88 "${THIRD_PARTY}/protobuf:protobuf_lite_static", 89 "${THIRD_PARTY}/protobuf:protobuf_static", 90 ] 91} 92