• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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("//base/hiviewdfx/faultloggerd/faultloggerd.gni")
15
16if (!defined(ohos_lite)) {
17  import("//build/config/features.gni")
18  import("//build/test.gni")
19
20  module_output_path = "faultloggerd/benchmarktest"
21
22  ohos_benchmarktest("UnwinderBenchmarkTest") {
23    module_out_path = module_output_path
24    include_dirs = [
25      "./",
26      "$faultloggerd_interfaces_path/common",
27      "$faultloggerd_path/test/utils",
28    ]
29    defines = [ "LOCK_TO_CPU" ]
30    if (libunwinder_debug) {
31      defines += [
32        "DFX_LOG_UNWIND",
33        "DFX_UNWIND_ERROR",
34      ]
35    }
36    sources = [
37      "$faultloggerd_test_path/benchmarktest/main/main_benchmark.cpp",
38      "elf_benchmark.cpp",
39      "unwind_local_benchmark.cpp",
40      "unwind_remote_benchmark.cpp",
41    ]
42    deps = [
43      "$faultloggerd_common_path/dfxlog:dfx_hilog",
44      "$faultloggerd_common_path/dfxutil:dfx_util",
45      "$faultloggerd_interfaces_path/innerkits/unwinder:libunwinder_static",
46      "$faultloggerd_path/test/utils:dfx_test_util",
47      "//third_party/benchmark:benchmark",
48    ]
49
50    external_deps = [
51      "c_utils:utils",
52      "hilog:libhilog",
53    ]
54  }
55
56  group("benchmarktest") {
57    testonly = true
58    deps = [ ":UnwinderBenchmarkTest" ]
59  }
60}
61