blob: b2c9dad1337d01b2d56ad9c5df17948d94055a58 [file] [log] [blame]
Florian Mayer07710c52019-09-16 15:53:38 +00001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15
16// Build variants {target} x {debug,ndebug} x {32,64}
17
18// This depends on the Perfetto client API. This uses the ProducerPort to
19// communicate to the system trace. This is an API whose ABI is maintained
20// to be backwards compatible, see
21// https://android.googlesource.com/platform/external/perfetto/+/refs/heads/master/protos/perfetto/ipc/producer_port.proto.
22
Bob Badour9150de62021-02-26 03:22:24 -080023package {
24 // See: http://go/android-license-faq
25 // A large-scale-change added 'default_applicable_licenses' to import
26 // all of the 'license_kinds' from "art_license"
27 // to get the below license kinds:
28 // SPDX-license-identifier-Apache-2.0
29 default_applicable_licenses: ["art_license"],
30}
31
Florian Mayer07710c52019-09-16 15:53:38 +000032gensrcs {
33 name: "art_perfetto_hprof_operator_srcs",
34 cmd: "$(location generate_operator_out) art/perfetto_hprof $(in) > $(out)",
35 tools: ["generate_operator_out"],
36 srcs: [
37 "perfetto_hprof.h",
38 ],
39 output_extension: "operator_out.cc",
40}
41
42cc_defaults {
43 name: "perfetto_hprof-defaults",
44 host_supported: false,
45 srcs: ["perfetto_hprof.cc"],
46 defaults: ["art_defaults"],
Florian Mayer07710c52019-09-16 15:53:38 +000047
48 // Note that this tool needs to be built for both 32-bit and 64-bit since it requires
49 // to be same ISA as what it is attached to.
50 compile_multilib: "both",
51
52 shared_libs: [
53 "libbase",
54 "liblog",
Florian Mayer29e62c32020-03-19 12:05:46 +010055 "libdexfile",
Florian Mayer07710c52019-09-16 15:53:38 +000056 ],
57 static_libs: [
58 "libperfetto_client_experimental",
Florian Mayer07710c52019-09-16 15:53:38 +000059 "perfetto_trace_protos",
Florian Mayer07710c52019-09-16 15:53:38 +000060 ],
Florian Mayer4bbc62b2019-09-25 12:13:35 +010061 generated_sources: [
Florian Mayer4bbc62b2019-09-25 12:13:35 +010062 "art_perfetto_hprof_operator_srcs",
63 ],
Florian Mayer07710c52019-09-16 15:53:38 +000064 target: {
65 darwin: {
66 enabled: false,
67 },
68 },
69 header_libs: [
70 "libnativehelper_header_only",
71 ],
Florian Mayer07710c52019-09-16 15:53:38 +000072}
73
74art_cc_library {
75 name: "libperfetto_hprof",
76 defaults: ["perfetto_hprof-defaults"],
77 shared_libs: [
78 "libart",
79 "libartbase",
80 ],
Jiyong Park066dd9022019-12-19 02:11:59 +000081 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +010082 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +000083 "com.android.art.debug",
84 ],
Florian Mayer07710c52019-09-16 15:53:38 +000085}
86
87art_cc_library {
88 name: "libperfetto_hprofd",
89 defaults: [
90 "art_debug_defaults",
91 "perfetto_hprof-defaults",
92 ],
93 shared_libs: [
94 "libartd",
95 "libartbased",
96 ],
Jiyong Park066dd9022019-12-19 02:11:59 +000097 apex_available: [
98 "com.android.art.debug",
99 ],
Florian Mayer07710c52019-09-16 15:53:38 +0000100}