• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
13import("//base/hiviewdfx/hiview/hiview.gni")
14import("//build/ohos.gni")
15
16config("log_catcher_config") {
17  visibility = [ "*:*" ]
18  include_dirs = [
19    "include",
20    "$hiview_adapter/plugins/eventlogger/log_catcher/include",
21    "$hiview_plugin/freeze_detector",
22  ]
23
24  cflags_cc = [ "-DDUMP_STACK_IN_PROCESS" ]
25}
26
27ohos_source_set("log_catcher") {
28  part_name = "hiview"
29  public_configs = [ ":log_catcher_config" ]
30
31  sources = [
32    "event_log_catcher.cpp",
33    "event_log_task.cpp",
34    "shell_catcher.cpp",
35  ]
36
37  deps = [
38    "$hiview_adapter/plugins/eventlogger/log_catcher:eventlogger_adapter_logcatcher",
39    "$hiview_base:hiviewbase",
40    "$hiview_interfaces/inner_api/unified_collection/utility:libucollection_utility",
41  ]
42
43  external_deps = [
44    "ability_base:want",
45    "ffrt:libffrt",
46    "hilog:libhilog",
47    "ipc:ipc_single",
48    "thermal_manager:thermalsrv_client",
49  ]
50
51  if (has_hiperf) {
52    cflags = [ "-DHAS_HIPERF" ]
53  }
54
55  defines = []
56
57  if (hiview_eventlogger_stacktrace_catcher_enable) {
58    sources += [ "open_stacktrace_catcher.cpp" ]
59    defines += [ "STACKTRACE_CATCHER_ENABLE" ]
60  }
61
62  if (hiview_eventlogger_binder_catcher_enable) {
63    sources += [
64      "binder_catcher.cpp",
65      "peer_binder_catcher.cpp",
66    ]
67    defines += [ "BINDER_CATCHER_ENABLE" ]
68  }
69
70  if (hiview_eventlogger_dmesg_catcher_enable) {
71    sources += [ "dmesg_catcher.cpp" ]
72    defines += [ "DMESG_CATCHER_ENABLE" ]
73  }
74
75  if (hiview_eventlogger_hilog_catcher_enable) {
76    defines += [ "HILOG_CATCHER_ENABLE" ]
77  }
78
79  if (hiview_eventlogger_hitrace_catcher_enable) {
80    defines += [ "HITRACE_CATCHER_ENABLE" ]
81  }
82
83  if (hiview_eventlogger_usage_catcher_enable) {
84    sources += [ "memory_catcher.cpp" ]
85    defines += [ "USAGE_CATCHER_ENABLE" ]
86  }
87
88  if (hiview_eventlogger_scb_catcher_enable) {
89    defines += [ "SCB_CATCHER_ENABLE" ]
90  }
91
92  if (hiview_eventlogger_other_catcher_enable) {
93    sources += [ "ffrt_catcher.cpp" ]
94    defines += [ "OTHER_CATCHER_ENABLE" ]
95  }
96}
97