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") 16ohos_source_set("elf") { 17 subsystem_name = "developtools" 18 part_name = "smartperf_host" 19 configs -= [ trace_cfg_path ] 20 configs += [ "../../gn:hiperf_trace_cfg" ] 21 cflags = [ "-D is_mingw=${is_mingw}" ] 22 sources = [ 23 "include/elf_parser.h", 24 "src/elf_file.cpp", 25 "src/elf_header.cpp", 26 "src/program_header.cpp", 27 "src/section_header.cpp", 28 "src/utilities.cpp", 29 ] 30 include_dirs = [ 31 "include", 32 "${SRC}/base", 33 "include/nonlinux/linux", 34 "include/nonlinux", 35 "${THIRD_PARTY}/perf_include/musl", 36 "${THIRD_PARTY}/bounds_checking_function/include", 37 "${SRC}/../prebuilts/emsdk/node/16.20.0_64bit/include/node", 38 ] 39} 40ohos_source_set("hiperf_src") { 41 configs -= [ trace_cfg_path ] 42 configs += [ "../../gn:hiperf_trace_cfg" ] 43 subsystem_name = "developtools" 44 part_name = "smartperf_host" 45 cflags = [ "-D ALWAYSTRUE" ] 46 sources = [ 47 "./src/callstack.cpp", 48 "./src/callstack.h", 49 "./src/dwarf_encoding.cpp", 50 "./src/dwarf_encoding.h", 51 "./src/elf_symbol.cpp", 52 "./src/hashlist.h", 53 "./src/option.cpp", 54 "./src/perf_event_record.cpp", 55 "./src/perf_file_format.cpp", 56 "./src/perf_file_reader.cpp", 57 "./src/register.cpp", 58 "./src/register.h", 59 "./src/report.cpp", 60 "./src/subcommand.cpp", 61 "./src/symbols_file.cpp", 62 "./src/virtual_runtime.cpp", 63 "./src/virtual_thread.cpp", 64 "include/symbols_file.h", 65 ] 66 include_dirs = [ 67 "linux", 68 "../", 69 "./", 70 "../../src/base", 71 "include", 72 "../../src/include", 73 "../../src/", 74 "../../src/trace_streamer", 75 "include/nonlinux", 76 "include/nonlinux/linux", 77 "${THIRD_PARTY}/bounds_checking_function/include", 78 ] 79 include_dirs += [ 80 "${THIRD_PARTY}/perf_include/libbpf", 81 "${THIRD_PARTY}/perf_include/musl", 82 "${THIRD_PARTY}/libunwind/include", 83 "${THIRD_PARTY}/libunwind/src", 84 "${THIRD_PARTY}/libunwind/include/tdep-x86_64", 85 ] 86} 87 88group("hiperf_platform_common") { 89 deps = [ 90 ":elf", 91 ":hiperf_src", 92 "${THIRD_PARTY}/protobuf:protobuf_lite_static", 93 "${THIRD_PARTY}/protobuf:protobuf_static", 94 ] 95} 96