• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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
23package {
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
32gensrcs {
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"],
47
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        "libartpalette",
54        "libbase",
55        "liblog",
56    ],
57    static_libs: [
58        "libperfetto_client_experimental",
59        "perfetto_trace_protos",
60    ],
61    generated_sources: [
62        "art_perfetto_hprof_operator_srcs",
63    ],
64    target: {
65        darwin: {
66            enabled: false,
67        },
68    },
69    header_libs: [
70        "libnativehelper_header_only",
71    ],
72    // FIXME: Workaround LTO build breakage
73    // http://b/241700157
74    lto: {
75        never: true,
76    },
77
78}
79
80art_cc_library {
81    name: "libperfetto_hprof",
82    defaults: ["perfetto_hprof-defaults"],
83    shared_libs: [
84        "libart",
85        "libartbase",
86        "libdexfile",
87    ],
88    apex_available: [
89        "com.android.art",
90        "com.android.art.debug",
91        "test_broken_com.android.art",
92    ],
93}
94
95art_cc_library {
96    name: "libperfetto_hprofd",
97    defaults: [
98        "art_debug_defaults",
99        "perfetto_hprof-defaults",
100    ],
101    shared_libs: [
102        "libartd",
103        "libartbased",
104        "libdexfiled",
105    ],
106    apex_available: [
107        "com.android.art.debug",
108    ],
109}
110