# 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("elf") { subsystem_name = "developtools" part_name = "smartperf_host" configs -= [ trace_cfg_path ] configs += [ "../../gn:hiperf_trace_cfg" ] cflags = [ "-D is_mingw=${is_mingw}" ] sources = [ "include/elf_parser.h", "src/elf_file.cpp", "src/elf_header.cpp", "src/program_header.cpp", "src/section_header.cpp", "src/utilities.cpp", ] include_dirs = [ "include", "${SRC}/base", "include/nonlinux/linux", "include/nonlinux", "${THIRD_PARTY}/perf_include/musl", "${THIRD_PARTY}/bounds_checking_function/include", "${SRC}/../prebuilts/emsdk/node/16.20.0_64bit/include/node", ] } ohos_source_set("hiperf_src") { configs -= [ trace_cfg_path ] configs += [ "../../gn:hiperf_trace_cfg" ] subsystem_name = "developtools" part_name = "smartperf_host" cflags = [ "-D ALWAYSTRUE" ] sources = [ "./src/callstack.cpp", "./src/callstack.h", "./src/dwarf_encoding.cpp", "./src/dwarf_encoding.h", "./src/elf_symbol.cpp", "./src/hashlist.h", "./src/option.cpp", "./src/perf_event_record.cpp", "./src/perf_file_format.cpp", "./src/perf_file_reader.cpp", "./src/register.cpp", "./src/register.h", "./src/report.cpp", "./src/subcommand.cpp", "./src/symbols_file.cpp", "./src/virtual_runtime.cpp", "./src/virtual_thread.cpp", "include/symbols_file.h", ] include_dirs = [ "linux", "../", "./", "../../src/base", "include", "../../src/include", "../../src/", "../../src/trace_streamer", "include/nonlinux", "include/nonlinux/linux", "${THIRD_PARTY}/bounds_checking_function/include", ] include_dirs += [ "${THIRD_PARTY}/perf_include/libbpf", "${THIRD_PARTY}/perf_include/musl", "${THIRD_PARTY}/libunwind/include", "${THIRD_PARTY}/libunwind/src", "${THIRD_PARTY}/libunwind/include/tdep-x86_64", ] } group("hiperf_platform_common") { deps = [ ":elf", ":hiperf_src", "${THIRD_PARTY}/protobuf:protobuf_lite_static", "${THIRD_PARTY}/protobuf:protobuf_static", ] }