• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/hiview/hiview.gni")
15import("//build/ohos.gni")
16
17if (hiview_enable_xperf_perfmonitor) {
18  config("xperf_perfmonitor_config") {
19    visibility = [ "*:*" ]
20
21    include_dirs = [
22      "common",
23      "common/event_builder",
24      "include",
25    ]
26
27    cflags_cc = [
28      "-DENABLE_SCREEM",
29      "-fexceptions",
30      "-fvisibility-inlines-hidden",
31      "-fvisibility=hidden",
32    ]
33  }
34
35  config("xperf_perfmonitor_public_config") {
36    visibility = [ "*:*" ]
37
38    include_dirs = [ "interfaces/inner_api/include" ]
39  }
40}
41
42ohos_shared_library("libperfmonitor") {
43  if (hiview_enable_xperf_perfmonitor) {
44    part_name = "hiview"
45    subsystem_name = "hiviewdfx"
46
47    sanitize = {
48      cfi = true
49      cfi_cross_dso = true
50      debug = false
51    }
52
53    sources = [
54      "common/perf_model.cpp",
55      "common/perf_trace.cpp",
56      "common/event_builder/xperf_event_builder.cpp",
57      "common/event_builder/xperf_event_reporter.cpp",
58      "interfaces/inner_api/src/perf_monitor_adapter.cpp",
59      "src/animator_monitor.cpp",
60      "src/input_monitor.cpp",
61      "src/jank_frame_monitor.cpp",
62      "src/perf_reporter.cpp",
63      "src/perf_utils.cpp",
64      "src/scene_monitor.cpp",
65      "src/white_block_monitor.cpp",
66      "src/surface_monitor.cpp",
67    ]
68
69    configs = [ ":xperf_perfmonitor_config" ]
70
71    public_configs = [ ":xperf_perfmonitor_public_config" ]
72
73    defines = []
74
75    deps = [ "$hiview_base:hiviewbase" ]
76
77    external_deps = [
78      "eventhandler:libeventhandler",
79      "graphic_2d:librender_service_client",
80      "graphic_2d:librender_service_base",
81      "hisysevent:libhisysevent",
82      "hitrace:hitrace_meter",
83      "hilog:libhilog",
84      "ipc:ipc_single",
85      "samgr:samgr_proxy"
86    ]
87
88    if (defined(global_parts_info) &&
89        defined(global_parts_info.resourceschedule_resource_schedule_service)) {
90      defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ]
91      external_deps += [ "resource_schedule_service:ressched_client" ]
92    }
93  }
94}
95
96group("unittest") {
97  testonly = true
98  deps = []
99}
100
101group("moduletest") {
102  testonly = true
103  deps = []
104}
105