• 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.
13
14import("//build/ohos.gni")
15OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR = "//third_party/protobuf"
16proto_dir = "//third_party/protogen"
17services_dir = "$proto_dir/services"
18ftrace_data_dir = "$proto_dir/types/plugins/ftrace_data"
19memory_data_dir = "$proto_dir/types/plugins/memory_data"
20hilog_data_dir = "$proto_dir/types/plugins/hilog_data"
21native_hook_dir = "$proto_dir/types/plugins/native_hook"
22hidump_data_dir = "$proto_dir/types/plugins/hidump_data"
23
24config("ts_proto_include_config") {
25  include_dirs = [
26    "$ftrace_data_dir",
27    "$memory_data_dir",
28    "$hilog_data_dir",
29    "$native_hook_dir",
30    "$hidump_data_dir",
31  ]
32}
33source_set("ts_proto_data_cpp") {
34  public_deps = [
35    "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf",
36    "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite",
37  ]
38  cflags = [
39    "-fPIC",
40    "-ftrapv",
41    "-fPIE",
42    "-D_FORTIFY_SOURCE=2 -O2",
43    "-Wno-zero-length-array",
44
45    #   "-Wl,--disable-new-dtags,--rpath,/libpath1:/libpath2"
46  ]
47  if (!use_wasm) {
48    cflags += [
49      "-fstack-protector-strong",  #
50      "-fstack-protector-all",
51    ]
52  }
53
54  public_configs = [ ":ts_proto_include_config" ]
55  sources = [
56    "$ftrace_data_dir/binder.pb.cc",
57    "$ftrace_data_dir/block.pb.cc",
58    "$ftrace_data_dir/cgroup.pb.cc",
59    "$ftrace_data_dir/clk.pb.cc",
60    "$ftrace_data_dir/compaction.pb.cc",
61    "$ftrace_data_dir/cpuhp.pb.cc",
62    "$ftrace_data_dir/dma_fence.pb.cc",
63    "$ftrace_data_dir/ext4.pb.cc",
64    "$ftrace_data_dir/filelock.pb.cc",
65    "$ftrace_data_dir/filemap.pb.cc",
66    "$ftrace_data_dir/ftrace.pb.cc",
67    "$ftrace_data_dir/ftrace_event.pb.cc",
68    "$ftrace_data_dir/gpio.pb.cc",
69    "$ftrace_data_dir/i2c.pb.cc",
70    "$ftrace_data_dir/ipi.pb.cc",
71    "$ftrace_data_dir/irq.pb.cc",
72    "$ftrace_data_dir/kmem.pb.cc",
73    "$ftrace_data_dir/net.pb.cc",
74    "$ftrace_data_dir/oom.pb.cc",
75    "$ftrace_data_dir/pagemap.pb.cc",
76    "$ftrace_data_dir/power.pb.cc",
77    "$ftrace_data_dir/printk.pb.cc",
78    "$ftrace_data_dir/raw_syscalls.pb.cc",
79    "$ftrace_data_dir/rcu.pb.cc",
80    "$ftrace_data_dir/sched.pb.cc",
81    "$ftrace_data_dir/signal.pb.cc",
82    "$ftrace_data_dir/sunrpc.pb.cc",
83    "$ftrace_data_dir/task.pb.cc",
84    "$ftrace_data_dir/timer.pb.cc",
85    "$ftrace_data_dir/trace_plugin_result.pb.cc",
86    "$ftrace_data_dir/v4l2.pb.cc",
87    "$ftrace_data_dir/vmscan.pb.cc",
88    "$ftrace_data_dir/workqueue.pb.cc",
89    "$ftrace_data_dir/writeback.pb.cc",
90    "$hidump_data_dir/hidump_plugin_config.pb.cc",
91    "$hidump_data_dir/hidump_plugin_result.pb.cc",
92    "$hilog_data_dir/hilog_plugin_result.pb.cc",
93    "$memory_data_dir/memory_plugin_common.pb.cc",
94    "$memory_data_dir/memory_plugin_config.pb.cc",
95    "$memory_data_dir/memory_plugin_result.pb.cc",
96    "$native_hook_dir/native_hook_config.pb.cc",
97    "$native_hook_dir/native_hook_result.pb.cc",
98    "${services_dir}/common_types.pb.cc",
99  ]
100}
101