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") 16config("ebpf_parser_cfg") { 17 if (!is_independent_compile) { 18 configs = [ "${TS_DIR}/gn:ts_config" ] 19 } 20 include_dirs = [ 21 ".", 22 "../", 23 "../..", 24 "../../trace_data", 25 "../../base", 26 "../../include", 27 "../../filter", 28 "../../cfg", 29 "../../trace_streamer", 30 "../../proto_reader/include", 31 "${THIRD_PARTY}/protobuf/src", 32 "${THIRD_PARTY}/sqlite/include", 33 "${THIRD_PARTY}/bounds_checking_function/include", 34 ] 35 include_dirs += [ 36 "${SRC}/trace_data/trace_stdtype", 37 "${SRC}/trace_data/trace_stdtype/ftrace", 38 "${SRC}/trace_data/trace_stdtype/ftrace/template", 39 "${SRC}/trace_data/trace_stdtype/hilog", 40 "${SRC}/trace_data/trace_stdtype/hiperf", 41 "${SRC}/trace_data/trace_stdtype/hisysevent", 42 "${SRC}/trace_data/trace_stdtype/htrace", 43 "${SRC}/trace_data/trace_stdtype/measure", 44 "${SRC}/trace_data/trace_stdtype/xpower", 45 ] 46 if (is_mingw || is_mac) { 47 include_dirs += [ "${THIRD_PARTY}/elfutils/libelf" ] 48 } 49 if (enable_ts_utest && !use_wasm) { 50 cflags = [ 51 "-fprofile-arcs", 52 "-ftest-coverage", 53 ] 54 ldflags = [ 55 "-fprofile-arcs", 56 "-ftest-coverage", 57 "--coverage", 58 ] 59 if (is_test) { 60 cflags += [ "-D IS_UT" ] 61 } 62 } 63} 64 65ohos_static_library("ebpf_parser") { 66 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 67 part_name = "${OHOS_PROFILER_PART_NAME}" 68 sources = [ 69 "bio_latency_data_parser.cpp", 70 "ebpf_base.cpp", 71 "ebpf_data_parser.cpp", 72 "ebpf_data_reader.cpp", 73 "ebpf_splitter.cpp", 74 "file_system_data_parser.cpp", 75 "paged_memory_data_parser.cpp", 76 ] 77 public_configs = [ ":ebpf_parser_cfg" ] 78 public_deps = [ 79 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader", 80 "${PERF_DIR}/hiperf:hiperf_src", 81 ] 82 deps = [ 83 "${THIRD_PARTY}/protobuf:protobuf_lite_static", 84 "${THIRD_PARTY}/protobuf:protobuf_static", 85 ] 86} 87