# 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("htrace_pbreader_parser_src") { subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "../parser_base.cpp", "htrace_clock_detail_parser.cpp", "htrace_cpu_data_parser.cpp", "htrace_cpu_parser/htrace_cpu_detail_parser.cpp", "htrace_disk_io_parser.cpp", "htrace_event_parser/htrace_event_parser.cpp", "htrace_hidump_parser.cpp", "htrace_hilog_parser.cpp", "htrace_hisysevent_parser.cpp", "htrace_js_cpu_profiler_parser.cpp", "htrace_js_memory_parser.cpp", "htrace_mem_parser.cpp", "htrace_native_hook_parser.cpp", "htrace_network_parser.cpp", "htrace_parser.cpp", "htrace_process_parser.cpp", "htrace_symbols_detail_parser.cpp", ] include_dirs = [ "../../proto_reader/include", ".", "htrace_event_parser", "htrace_cpu_parser", "../../include", "../../", "../", "../../trace_data", "../../cfg", "../../trace_streamer", "../../metrics", "${THIRD_PARTY}/bounds_checking_function/include", "${THIRD_PARTY}/protobuf/src", "${THIRD_PARTY}/sqlite/include", "${THIRD_PARTY}/json/single_include/nlohmann", "../../filter", "../../base", "../ebpf_parser", ] include_dirs += [ "${THIRD_PARTY}/libunwind/include", "${THIRD_PARTY}/libunwind/src", "${PERF_DIR}/hiperf/include", "${PERF_DIR}/hiperf/include/nonlinux/linux", "${PERF_DIR}/hiperf/include/nonlinux", "${THIRD_PARTY}/googletest/googletest/include", "${THIRD_PARTY}/perf_include/libbpf", "${THIRD_PARTY}/perf_include/include", "${THIRD_PARTY}/perf_include", "${THIRD_PARTY}/perf_include/linux", "../hiperf_parser", "../hiperf_parser/include", "${COMMON_LIBRARY}/c_utils/base/include", "${THIRD_PARTY}/sqlite", ] include_dirs += [ "${THIRD_PARTY}/perf_include/hiviewdfx/hilog/include", "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/common/cutil", "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/common/dfxlog", "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/common/dfxutil", "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/common", "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/nonlinux", "${THIRD_PARTY}/perf_include/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/include", ] 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_mingw || is_mac) { include_dirs += [ "${THIRD_PARTY}/elfutils/libelf", "${THIRD_PARTY}/libbpf/include/uapi", ] } 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" ] } } if (is_mingw) { cflags = [ "-includeMingW64Fix.h" ] } public_deps = [] deps = [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp_standard", "${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/ftrace_data/${device_kernel_version}:ftrace_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", ] } group("htrace_pbreader_parser") { deps = [ ":htrace_pbreader_parser_src", "${THIRD_PARTY}/protobuf:protobuf_lite_static", "${THIRD_PARTY}/protobuf:protobuf_static", "//third_party/perf_include/hiviewdfx:hiviewdfx", ] if (!use_wasm && !is_win && !is_mingw && !is_mac && !is_test) { if (!is_independent_compile) { if (target_cpu == "arm64") { deps += [ "//third_party/libunwind:unwind_source_arm64_opt" ] } else { deps += [ "//third_party/libunwind:unwind_source_${target_cpu}" ] } } else { deps += [ "${THIRD_PARTY}/libunwind:libunwind" ] } } }