• 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/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    cflags = [
30      "-O0",
31      "-Werror",
32      "-Wno-reorder-init-list",
33      "-Wno-header-hygiene",
34    ]
35    ldflags = [ "-rdynamic" ]
36    defines = [ "LOCK_TO_CPU" ]
37    if (libunwinder_debug) {
38      defines += [ "DFX_LOG_UNWIND" ]
39    }
40    sources = [
41      "$faultloggerd_test_path/benchmarktest/main/main_benchmark.cpp",
42      "elf_benchmark.cpp",
43      "maps_benchmark.cpp",
44      "unwind_local_benchmark.cpp",
45      "unwind_local_tid_benchmark.cpp",
46      "unwind_remote_benchmark.cpp",
47    ]
48    deps = [
49      "$faultloggerd_common_path/dfxlog:dfx_hilog",
50      "$faultloggerd_common_path/dfxutil:dfx_util",
51      "$faultloggerd_interfaces_path/innerkits/unwinder:libunwinder_static",
52      "$faultloggerd_path/test/utils:dfx_test_util",
53    ]
54
55    external_deps = [
56      "benchmark:benchmark",
57      "c_utils:utils",
58      "hilog:libhilog",
59    ]
60  }
61
62  group("benchmarktest") {
63    testonly = true
64    deps = [ ":UnwinderBenchmarkTest" ]
65  }
66}
67