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") 16 17ohos_source_set("parser") { 18 subsystem_name = "developtools" 19 part_name = "smartperf_host" 20 sources = [ 21 "bytrace_parser/bytrace_event_parser.cpp", 22 "bytrace_parser/bytrace_event_parser.h", 23 "bytrace_parser/bytrace_parser.cpp", 24 "bytrace_parser/bytrace_parser.h", 25 "common_types.h", 26 "event_parser_base.cpp", 27 "event_parser_base.h", 28 "print_event_parser.cpp", 29 "print_event_parser.h", 30 "thread_state_flag.cpp", 31 "thread_state_flag.h", 32 ] 33 deps = [ 34 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_encoder", 35 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/diskio_data:diskio_data_encoder", 36 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hidump_data:hidump_data_encoder", 37 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_encoder", 38 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_encoder", 39 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/js_memory:js_memory_data_encoder", 40 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_encoder", 41 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_data_encoder", 42 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/network_data:network_data_encoder", 43 "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/process_data:process_data_encoder", 44 "ebpf_parser:ebpf_parser", 45 ] 46 deps += [ "htrace_pbreader_parser:htrace_pbreader_parser" ] 47 48 include_dirs = [ 49 "${THIRD_PARTY}/protobuf/src", 50 "${THIRD_PARTY}/sqlite/include", 51 "${SRC}/base", 52 "${SRC}/cfg", 53 "${SRC}/trace_streamer", 54 "${SRC}/trace_data", 55 "${SRC}/include", 56 "${SRC}/filter", 57 "${SRC}", 58 ".", 59 "${THIRD_PARTY}/json-master/single_include/nlohmann", 60 ] 61 62 include_dirs += [ "htrace_pbreader_parser" ] 63 include_dirs += [ "../proto_reader/include" ] 64 65 if (enable_ts_utest && !use_wasm) { 66 cflags = [ 67 "-fprofile-arcs", 68 "-ftest-coverage", 69 ] 70 ldflags = [ 71 "-fprofile-arcs", 72 "-ftest-coverage", 73 "--coverage", 74 ] 75 if (is_test) { 76 cflags += [ "-D IS_UT" ] 77 } 78 } 79} 80