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("../../ts.gni") 16ohos_source_set("ebpf_parser_src") { 17 sources = [ 18 "bio_latency_data_parser.cpp", 19 "bio_latency_data_parser.h", 20 "ebpf_base.cpp", 21 "ebpf_base.h", 22 "ebpf_data_parser.cpp", 23 "ebpf_data_parser.h", 24 "ebpf_data_reader.cpp", 25 "ebpf_data_reader.h", 26 "ebpf_stdtype.h", 27 "file_system_data_parser.cpp", 28 "file_system_data_parser.h", 29 "paged_memory_data_parser.cpp", 30 "paged_memory_data_parser.h", 31 ] 32 include_dirs = [ 33 ".", 34 "../", 35 "../htrace_parser", 36 "../..", 37 "../../trace_data", 38 "../../base", 39 "../../include", 40 "../../filter", 41 "../../cfg", 42 "../../trace_streamer", 43 "${OHOS_PROTO_GEN}", 44 "${OHOS_PROTO_GEN}/types/plugins/memory_data", 45 "${OHOS_PROTO_GEN}/types/plugins/ftrace_data/${kernel_version}", 46 "${OHOS_PROTO_GEN}/types/plugins/hilog_data", 47 "${OHOS_PROTO_GEN}/types/plugins/native_hook", 48 "${OHOS_PROTO_GEN}/types/plugins/hidump_data", 49 "${OHOS_PROTO_GEN}/types/plugins/network_data", 50 "${OHOS_PROTO_GEN}/types/plugins/cpu_data", 51 "${OHOS_PROTO_GEN}/types/plugins/diskio_data", 52 "${OHOS_PROTO_GEN}/types/plugins/process_data", 53 "${OHOS_PROTO_GEN}/types/plugins/hisysevent_data", 54 "//third_party/protobuf/src", 55 "//third_party/sqlite/include", 56 ] 57 if (is_win || is_macx) { 58 include_dirs += [ "//third_party/perf_include/linux" ] 59 } 60 61 if (enable_ts_utest && !use_wasm) { 62 cflags = [ 63 "-fprofile-arcs", 64 "-ftest-coverage", 65 ] 66 ldflags = [ 67 "-fprofile-arcs", 68 "-ftest-coverage", 69 "--coverage", 70 ] 71 if (is_macx && is_test) { 72 cflags += [ "-D UT_MAC" ] 73 } 74 } 75} 76 77group("ebpf_parser") { 78 deps = [ 79 ":ebpf_parser_src", 80 "//third_party/protobuf:protobuf", 81 "//third_party/protobuf:protobuf_lite", 82 ] 83} 84