blob: 9b7dda750d659c33b5d19ef4a8dc755f38fafb90 [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
Lalit Magantiaa035b22019-12-20 16:13:09 +000013java_library_host {
Julien Desprez03858802022-07-26 16:15:12 -070014 name: "perfetto_trace-full",
15 proto: {
16 type: "full",
17 },
18 srcs: [
19 "protos/perfetto/trace/perfetto_trace.proto",
20 ],
21}
22
23java_library_host {
Colin Cross84172332021-09-14 16:41:33 -070024 name: "perfetto_metrics-full",
25 proto: {
26 type: "full",
27 },
28 srcs: [
29 "protos/perfetto/metrics/perfetto_merged_metrics.proto",
30 ],
Lalit Magantiaa035b22019-12-20 16:13:09 +000031}
32
Primiano Tucci0b651b82019-06-03 17:16:23 +010033// This sample target shows how to use the perfetto client API from within the
34// Android tree.
35cc_binary {
Colin Cross84172332021-09-14 16:41:33 -070036 name: "libperfetto_client_example",
37 srcs: [
38 "test/client_api_example.cc",
39 ],
40 static_libs: [
41 "libperfetto_client_experimental",
42 "perfetto_trace_protos",
43 ],
44 shared_libs: [
45 "libprotobuf-cpp-lite",
46 "liblog",
47 ],
48 cflags: [
49 "-DGOOGLE_PROTOBUF_NO_RTTI",
50 "-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
51 ],
52 defaults: [
53 "perfetto_defaults",
54 ],
Primiano Tucci0b651b82019-06-03 17:16:23 +010055}
Hector Dearman92d7d112019-12-05 15:19:57 +000056
57cc_library_static {
58 name: "libstatslog_perfetto",
59 generated_sources: ["statslog_perfetto.cpp"],
60 generated_headers: ["statslog_perfetto.h"],
61 cflags: [
62 "-Wall",
63 "-Werror",
64 ],
65 export_generated_headers: ["statslog_perfetto.h"],
66 shared_libs: [
67 "libcutils",
68 "liblog",
69 "libstatssocket",
70 "libutils",
71 ],
72}
73
74genrule {
75 name: "statslog_perfetto.h",
76 tools: ["stats-log-api-gen"],
77 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_perfetto.h --module perfetto --namespace perfetto,android_internal",
78 out: [
79 "statslog_perfetto.h",
80 ],
81}
82
83genrule {
84 name: "statslog_perfetto.cpp",
85 tools: ["stats-log-api-gen"],
86 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_perfetto.cpp --module perfetto --namespace perfetto,android_internal --importHeader statslog_perfetto.h",
87 out: [
88 "statslog_perfetto.cpp",
89 ],
90}
Florian Mayer1584c262021-03-05 13:11:22 +000091
Kalesh Singh8c1eb4b2021-03-30 11:59:09 -040092sh_binary {
93 name: "mm_events",
94 src: "tools/mm_events",
95}
96
Florian Mayer1584c262021-03-05 13:11:22 +000097package {
98 default_applicable_licenses: ["external_perfetto_license"],
99}
100
Paul Thomson109ce872021-04-07 11:41:06 +0100101python_library {
102 name: "perfetto-trace-processor-python",
103 srcs: [
104 ":perfetto-trace-processor-python-srcs",
105 ],
106 data: [
107 ":perfetto-trace-processor-python-data",
108 ],
109 version: {
110 py2: {
111 enabled: false,
112 },
113 py3: {
114 enabled: true,
115 },
116 },
117 libs: [
118 "libprotobuf-python",
119 ],
120 host_supported: true,
121}
122
123filegroup {
124 name: "perfetto-trace-processor-python-srcs",
Lalit Maganti4c76b4d2022-01-11 15:37:41 +0000125 srcs: ["python/perfetto/trace_processor/*.py"],
126 path: "python",
Paul Thomson109ce872021-04-07 11:41:06 +0100127}
128
129filegroup {
130 name: "perfetto-trace-processor-python-data",
Lalit Maganti4c76b4d2022-01-11 15:37:41 +0000131 srcs: ["python/perfetto/trace_processor/*.descriptor*"],
132 path: "python",
Paul Thomson109ce872021-04-07 11:41:06 +0100133}
134
Florian Mayer1584c262021-03-05 13:11:22 +0000135// Added automatically by a large-scale-change that took the approach of
136// 'apply every license found to every target'. While this makes sure we respect
137// every license restriction, it may not be entirely correct.
138//
139// e.g. GPL in an MIT project might only apply to the contrib/ directory.
140//
141// Please consider splitting the single license below into multiple licenses,
142// taking care not to lose any license_kind information, and overriding the
143// default license using the 'licenses: [...]' property on targets as needed.
144//
145// For unused files, consider creating a 'fileGroup' with "//visibility:private"
146// to attach the license to, and including a comment whether the files may be
147// used in the current project.
148// See: http://go/android-license-faq
149license {
150 name: "external_perfetto_license",
151 visibility: [":__subpackages__"],
152 license_kinds: [
153 "SPDX-license-identifier-Apache-2.0",
154 "SPDX-license-identifier-BSD",
155 "SPDX-license-identifier-CC-BY",
156 ],
157 license_text: [
158 "LICENSE",
159 ],
160}