hiperf部件整改

Signed-off-by: mashaohua7 <mashaohua7@huawei.com>
This commit is contained in:
mashaohua7 2023-05-31 15:44:47 +08:00
parent e899a0ff8e
commit dce95d30d1
3 changed files with 50 additions and 11 deletions

View File

@ -143,7 +143,6 @@ sources_platform_linux = [
common_deps = [
":support_elf",
":support_protobuf",
"../../base/hiviewdfx/faultloggerd/interfaces/innerkits/callstack:callstack_perf",
"//third_party/bounds_checking_function:libsec_static",
"//third_party/zlib:libz",
]
@ -170,7 +169,6 @@ config("hiperf_syspara_config") {
if (is_ohos && hiperf_use_syspara) {
common_configs += [ ":hiperf_syspara_config" ]
common_deps += [ "../../base/startup/init/interfaces/innerkits:libbegetutil" ]
}
ohos_source_set("hiperf_platform_common") {
@ -186,11 +184,14 @@ ohos_source_set("hiperf_platform_common") {
"bundle_framework:appexecfwk_base",
"bundle_framework:appexecfwk_core",
"c_utils:utils",
"faultloggerd:callstack_perf",
"hiviewdfx_hilog_native:libhilog",
"init:libbegetutil",
"ipc:ipc_core",
"samgr:samgr_proxy",
]
} else {
external_deps = [ "faultloggerd:callstack_perf" ]
defines += [ "CONFIG_NO_HILOG" ]
}
sources = sources_platform_common
@ -207,6 +208,13 @@ ohos_source_set("hiperf_platform_linux") {
public_deps = common_deps
public_configs = common_configs
if (is_ohos) {
external_deps = [
"faultloggerd:callstack_perf",
"init:libbegetutil",
]
}
public_configs += [ ":platform_linux_config" ]
configs = [ "interfaces/innerkits/native:hiperf_client_config" ]
@ -336,6 +344,10 @@ ohos_executable("hiperf") {
static_link = true
}
if (is_ohos) {
external_deps = [ "faultloggerd:callstack_perf" ]
}
if (is_linux || is_mingw) {
# ld.lld: error: attempted static link of dynamic object hiviewdfx/hilog_native/libhilog.so
static_link = true
@ -353,6 +365,7 @@ ohos_executable("hiperf_host") {
static_link = true
}
external_deps = [ "faultloggerd:callstack_perf" ]
subsystem_name = "developtools"
part_name = "hiperf"
}
@ -399,6 +412,7 @@ ohos_source_set("hiperf_platform_host") {
subsystem_name = "developtools"
sources = [ "./src/hiperf_libreport.cpp" ]
public_deps = [ ":hiperf_platform_common" ]
external_deps = [ "faultloggerd:callstack_perf" ]
}
ohos_shared_library("hiperf_host_lib") {
@ -407,6 +421,7 @@ ohos_shared_library("hiperf_host_lib") {
ldflags = [ "-static-libstdc++" ]
external_deps = [ "faultloggerd:callstack_perf" ]
subsystem_name = "developtools"
part_name = "hiperf"
}

View File

@ -20,11 +20,17 @@
"deps": {
"components": [
"hiviewdfx_hilog_native",
"napi"
"napi",
"samgr",
"ipc",
"c_utils",
"bundle_framework"
],
"third_party": [
"libz",
"libsec_static"
"zlib",
"libsec_static",
"bounds_checking_function",
"protobuf"
]
},
"build": {

View File

@ -92,7 +92,10 @@ ohos_unittest("hiperf_unittest") {
module_out_path = module_output_path
resource_config_file = "unittest/resource/ohos_test.xml"
deps = common_deps
external_deps = [ "hilog_native:libhilog" ]
external_deps = [
"faultloggerd:callstack_perf",
"hilog_native:libhilog",
]
cflags = [
"-Dprivate=public", #allow test code access private members
]
@ -122,7 +125,10 @@ ohos_fuzztest("CommandLineFuzzTest") {
configs = [ ":hiperf_test_config" ]
cflags = fuzz_cflags
deps = fuzz_deps
external_deps = [ "hilog_native:libhilog" ]
external_deps = [
"faultloggerd:callstack_perf",
"hilog_native:libhilog",
]
defines = [ "FUZZER_TEST" ]
sources = [
"${hiperf_path}/src/main.cpp",
@ -136,7 +142,10 @@ ohos_fuzztest("LibReportFuzzTest") {
configs = [ ":hiperf_test_config" ]
cflags = fuzz_cflags
deps = fuzz_deps
external_deps = [ "hilog_native:libhilog" ]
external_deps = [
"faultloggerd:callstack_perf",
"hilog_native:libhilog",
]
defines = [ "FUZZER_TEST" ]
sources = [ "fuzztest/libreport_fuzzer/LibReport_fuzzer.cpp" ]
}
@ -147,7 +156,10 @@ ohos_fuzztest("ClientApiFuzzTest") {
configs = [ ":hiperf_test_config" ]
cflags = fuzz_cflags
deps = fuzz_deps
external_deps = [ "hilog_native:libhilog" ]
external_deps = [
"faultloggerd:callstack_perf",
"hilog_native:libhilog",
]
defines = [ "FUZZER_TEST" ]
sources = [ "fuzztest/clientapi_fuzzer/ClientApi_fuzzer.cpp" ]
}
@ -159,7 +171,10 @@ ohos_fuzztest("PerfFileFuzzTest") {
configs = [ ":hiperf_test_config" ]
cflags = fuzz_cflags
deps = fuzz_deps
external_deps = [ "hilog_native:libhilog" ]
external_deps = [
"faultloggerd:callstack_perf",
"hilog_native:libhilog",
]
defines = [ "FUZZER_TEST" ]
sources = [ "fuzztest/perffile_fuzzer/PerfFile_fuzzer.cpp" ]
}
@ -171,7 +186,10 @@ ohos_fuzztest("ElfParserFuzzTest") {
configs = [ ":hiperf_test_config" ]
cflags = fuzz_cflags
deps = fuzz_deps
external_deps = [ "hilog_native:libhilog" ]
external_deps = [
"faultloggerd:callstack_perf",
"hilog_native:libhilog",
]
defines = [ "FUZZER_TEST" ]
sources = [ "fuzztest/elfparser_fuzzer/ElfParser_fuzzer.cpp" ]
}