blob: 9c7b0b08c3c5d604587e2439290052e5c7036cf9 [file] [log] [blame]
Lalit Maganti83e712a2018-02-05 15:48:00 +00001// These targets are appended to the autogenerated Android.bp by tools/gen_android_bp.
Primiano Tuccif9551982019-09-06 13:48:01 +01002
Lalit Magantif5d666d2018-10-23 14:23:24 +01003java_library_host {
Colin Cross84172332021-09-14 16:41:33 -07004 name: "perfetto_config-full",
5 proto: {
6 type: "full",
7 },
8 srcs: [
9 "protos/perfetto/config/perfetto_config.proto",
10 ],
Lalit Maganti6820cb62018-10-05 13:34:22 +010011}
Primiano Tucci0b651b82019-06-03 17:16:23 +010012
Kean Mariottia977e772023-06-06 08:27:55 +000013java_library {
14 name: "perfetto_config-lite",
15 proto: {
16 type: "lite",
17 },
18 srcs: [
19 "protos/perfetto/config/perfetto_config.proto",
20 ],
21}
22
Lalit Magantiaa035b22019-12-20 16:13:09 +000023java_library_host {
Julien Desprez03858802022-07-26 16:15:12 -070024 name: "perfetto_trace-full",
25 proto: {
26 type: "full",
27 },
28 srcs: [
29 "protos/perfetto/trace/perfetto_trace.proto",
30 ],
Sorin Bascafdf4fb22023-02-04 15:52:44 +000031 // b/267831518: Pin tradefed and dependencies to Java 11.
32 java_version: "11",
Julien Desprez03858802022-07-26 16:15:12 -070033}
34
35java_library_host {
Colin Cross84172332021-09-14 16:41:33 -070036 name: "perfetto_metrics-full",
37 proto: {
38 type: "full",
39 },
40 srcs: [
41 "protos/perfetto/metrics/perfetto_merged_metrics.proto",
42 ],
Sorin Bascafdf4fb22023-02-04 15:52:44 +000043 // b/267831518: Pin tradefed and dependencies to Java 11.
44 java_version: "11",
Lalit Magantiaa035b22019-12-20 16:13:09 +000045}
46
Primiano Tucci0b651b82019-06-03 17:16:23 +010047// This sample target shows how to use the perfetto client API from within the
48// Android tree.
49cc_binary {
Colin Cross84172332021-09-14 16:41:33 -070050 name: "libperfetto_client_example",
51 srcs: [
52 "test/client_api_example.cc",
53 ],
54 static_libs: [
55 "libperfetto_client_experimental",
56 "perfetto_trace_protos",
57 ],
58 shared_libs: [
59 "libprotobuf-cpp-lite",
60 "liblog",
61 ],
62 cflags: [
63 "-DGOOGLE_PROTOBUF_NO_RTTI",
64 "-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
65 ],
66 defaults: [
67 "perfetto_defaults",
68 ],
Primiano Tucci0b651b82019-06-03 17:16:23 +010069}
Hector Dearman92d7d112019-12-05 15:19:57 +000070
71cc_library_static {
72 name: "libstatslog_perfetto",
73 generated_sources: ["statslog_perfetto.cpp"],
74 generated_headers: ["statslog_perfetto.h"],
75 cflags: [
76 "-Wall",
77 "-Werror",
78 ],
79 export_generated_headers: ["statslog_perfetto.h"],
80 shared_libs: [
81 "libcutils",
82 "liblog",
83 "libstatssocket",
84 "libutils",
85 ],
86}
87
88genrule {
89 name: "statslog_perfetto.h",
90 tools: ["stats-log-api-gen"],
91 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_perfetto.h --module perfetto --namespace perfetto,android_internal",
92 out: [
93 "statslog_perfetto.h",
94 ],
95}
96
97genrule {
98 name: "statslog_perfetto.cpp",
99 tools: ["stats-log-api-gen"],
100 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_perfetto.cpp --module perfetto --namespace perfetto,android_internal --importHeader statslog_perfetto.h",
101 out: [
102 "statslog_perfetto.cpp",
103 ],
104}
Florian Mayer1584c262021-03-05 13:11:22 +0000105
Kalesh Singh8c1eb4b2021-03-30 11:59:09 -0400106sh_binary {
107 name: "mm_events",
108 src: "tools/mm_events",
109}
110
Florian Mayer1584c262021-03-05 13:11:22 +0000111package {
112 default_applicable_licenses: ["external_perfetto_license"],
113}
114
Paul Thomson109ce872021-04-07 11:41:06 +0100115python_library {
116 name: "perfetto-trace-processor-python",
117 srcs: [
118 ":perfetto-trace-processor-python-srcs",
Tomas Urbonaitis63735472022-08-11 15:18:06 +0200119 ":perfetto-trace-uri-resolver-python-srcs",
Paul Thomson109ce872021-04-07 11:41:06 +0100120 ],
121 data: [
122 ":perfetto-trace-processor-python-data",
123 ],
Paul Thomson109ce872021-04-07 11:41:06 +0100124 libs: [
125 "libprotobuf-python",
126 ],
127 host_supported: true,
128}
129
130filegroup {
Tomas Urbonaitis63735472022-08-11 15:18:06 +0200131 name: "perfetto-trace-uri-resolver-python-srcs",
132 srcs: ["python/perfetto/trace_uri_resolver/*.py"],
133 path: "python",
134}
135
136filegroup {
Paul Thomson109ce872021-04-07 11:41:06 +0100137 name: "perfetto-trace-processor-python-srcs",
Lalit Maganti4c76b4d2022-01-11 15:37:41 +0000138 srcs: ["python/perfetto/trace_processor/*.py"],
139 path: "python",
Paul Thomson109ce872021-04-07 11:41:06 +0100140}
141
142filegroup {
143 name: "perfetto-trace-processor-python-data",
Lalit Maganti4c76b4d2022-01-11 15:37:41 +0000144 srcs: ["python/perfetto/trace_processor/*.descriptor*"],
145 path: "python",
Paul Thomson109ce872021-04-07 11:41:06 +0100146}
147
Florian Mayer1584c262021-03-05 13:11:22 +0000148// Added automatically by a large-scale-change that took the approach of
149// 'apply every license found to every target'. While this makes sure we respect
150// every license restriction, it may not be entirely correct.
151//
152// e.g. GPL in an MIT project might only apply to the contrib/ directory.
153//
154// Please consider splitting the single license below into multiple licenses,
155// taking care not to lose any license_kind information, and overriding the
156// default license using the 'licenses: [...]' property on targets as needed.
157//
158// For unused files, consider creating a 'fileGroup' with "//visibility:private"
159// to attach the license to, and including a comment whether the files may be
160// used in the current project.
161// See: http://go/android-license-faq
162license {
163 name: "external_perfetto_license",
164 visibility: [":__subpackages__"],
165 license_kinds: [
166 "SPDX-license-identifier-Apache-2.0",
167 "SPDX-license-identifier-BSD",
168 "SPDX-license-identifier-CC-BY",
169 ],
170 license_text: [
171 "LICENSE",
172 ],
173}
Pablo Gamito40e6e682023-12-04 12:04:33 +0000174
175// TODO(b/315118713): use list of proto file sources instead of merged proto
176gensrcs {
177 name: "perfetto_trace_javastream_protos",
178 srcs: [
179 "protos/perfetto/trace/perfetto_trace.proto",
180 ],
181 tools: [
182 "aprotoc",
183 "protoc-gen-javastream",
184 "soong_zip",
185 ],
186 cmd: "mkdir -p $(genDir)/$(in) " +
187 "&& $(location aprotoc) " +
188 "--plugin=$(location protoc-gen-javastream) " +
189 "--javastream_out=$(genDir)/$(in) " +
190 "-Iexternal/protobuf/src " +
191 "-Iexternal/perfetto " +
192 "-I . $(in) " +
193 "&& $(location soong_zip) " +
194 "-jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)",
195 data: [
196 ":libprotobuf-internal-protos",
197 ],
198 output_extension: "srcjar",
199}