# Copyright (C) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("../../build/ts.gni") ohos_source_set("parser") { subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "bytrace_parser/bytrace_event_parser.cpp", "bytrace_parser/bytrace_hilog_parser.cpp", "bytrace_parser/bytrace_hisysevent_parser.cpp", "bytrace_parser/bytrace_parser.cpp", "event_parser_base.cpp", "print_event_parser.cpp", "thread_state_flag.cpp", ] deps = [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_reader", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/diskio_data:diskio_data_reader", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hidump_data:hidump_data_reader", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_reader", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_reader", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/js_memory:js_memory_data_reader", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_data_reader", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/network_data:network_data_reader", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/process_data:process_data_reader", "ebpf_parser:ebpf_parser", ] deps += [ "htrace_pbreader_parser:htrace_pbreader_parser" ] deps += [ "rawtrace_parser:rawtrace_parser" ] include_dirs = [ "${THIRD_PARTY}/protobuf/src", "${THIRD_PARTY}/sqlite/include", "${SRC}/base", "${SRC}/cfg", "${SRC}/trace_streamer", "${SRC}/trace_data", "${SRC}/include", "${SRC}/filter", "${SRC}", ".", "htrace_pbreader_parser", "rawtrace_parser", "../proto_reader/include", "${THIRD_PARTY}/bounds_checking_function/include", "${THIRD_PARTY}/json/single_include/nlohmann", ] include_dirs += [ "${SRC}/trace_data/trace_stdtype", "${SRC}/trace_data/trace_stdtype/ftrace", "${SRC}/trace_data/trace_stdtype/ftrace/template", "${SRC}/trace_data/trace_stdtype/hilog", "${SRC}/trace_data/trace_stdtype/hiperf", "${SRC}/trace_data/trace_stdtype/hisysevent", "${SRC}/trace_data/trace_stdtype/htrace", "${SRC}/trace_data/trace_stdtype/measure", ] if (!is_independent_compile) { configs = [ "${TS_DIR}/gn:ts_config" ] } if (enable_ts_utest && !use_wasm) { cflags = [ "-fprofile-arcs", "-ftest-coverage", ] ldflags = [ "-fprofile-arcs", "-ftest-coverage", "--coverage", ] if (is_test) { cflags += [ "-D IS_UT" ] } } }