1# Copyright (C) 2021 Huawei Device Co., Ltd. 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") 16ohos_source_set("ebpf_parser_src") { 17 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 18 part_name = "${OHOS_PROFILER_PART_NAME}" 19 if (!is_independent_compile) { 20 configs = [ "${TS_DIR}/gn:ts_config" ] 21 } 22 sources = [ 23 "bio_latency_data_parser.cpp", 24 "ebpf_base.cpp", 25 "ebpf_data_parser.cpp", 26 "ebpf_data_reader.cpp", 27 "file_system_data_parser.cpp", 28 "paged_memory_data_parser.cpp", 29 ] 30 include_dirs = [ 31 ".", 32 "../", 33 "../..", 34 "../../trace_data", 35 "../../base", 36 "../../include", 37 "../../filter", 38 "../../cfg", 39 "../../trace_streamer", 40 "${THIRD_PARTY}/protobuf/src", 41 "${THIRD_PARTY}/sqlite/include", 42 "${THIRD_PARTY}/bounds_checking_function/include", 43 ] 44 public_deps = [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader" ] 45 if (is_win || is_macx || is_mingw) { 46 include_dirs += [ 47 "${THIRD_PARTY}/perf_include/linux", 48 "${THIRD_PARTY}/perf_include/musl", 49 ] 50 } 51 52 if (enable_ts_utest && !use_wasm) { 53 cflags = [ 54 "-fprofile-arcs", 55 "-ftest-coverage", 56 ] 57 ldflags = [ 58 "-fprofile-arcs", 59 "-ftest-coverage", 60 "--coverage", 61 ] 62 if (is_test) { 63 cflags += [ "-D IS_UT" ] 64 } 65 } 66} 67 68group("ebpf_parser") { 69 deps = [ 70 ":ebpf_parser_src", 71 "${THIRD_PARTY}/protobuf:protobuf_lite_static", 72 "${THIRD_PARTY}/protobuf:protobuf_static", 73 ] 74} 75