Lalit Maganti | 83e712a | 2018-02-05 15:48:00 +0000 | [diff] [blame] | 1 | // These targets are appended to the autogenerated Android.bp by tools/gen_android_bp. |
Primiano Tucci | f955198 | 2019-09-06 13:48:01 +0100 | [diff] [blame] | 2 | |
Lalit Maganti | f5d666d | 2018-10-23 14:23:24 +0100 | [diff] [blame] | 3 | java_library_host { |
Colin Cross | 8417233 | 2021-09-14 16:41:33 -0700 | [diff] [blame] | 4 | name: "perfetto_config-full", |
| 5 | proto: { |
| 6 | type: "full", |
| 7 | }, |
| 8 | srcs: [ |
| 9 | "protos/perfetto/config/perfetto_config.proto", |
| 10 | ], |
Lalit Maganti | 6820cb6 | 2018-10-05 13:34:22 +0100 | [diff] [blame] | 11 | } |
Primiano Tucci | 0b651b8 | 2019-06-03 17:16:23 +0100 | [diff] [blame] | 12 | |
Kean Mariotti | a977e77 | 2023-06-06 08:27:55 +0000 | [diff] [blame] | 13 | java_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 Maganti | aa035b2 | 2019-12-20 16:13:09 +0000 | [diff] [blame] | 23 | java_library_host { |
Julien Desprez | 0385880 | 2022-07-26 16:15:12 -0700 | [diff] [blame] | 24 | name: "perfetto_trace-full", |
| 25 | proto: { |
| 26 | type: "full", |
| 27 | }, |
| 28 | srcs: [ |
| 29 | "protos/perfetto/trace/perfetto_trace.proto", |
| 30 | ], |
Sorin Basca | fdf4fb2 | 2023-02-04 15:52:44 +0000 | [diff] [blame] | 31 | // b/267831518: Pin tradefed and dependencies to Java 11. |
| 32 | java_version: "11", |
Julien Desprez | 0385880 | 2022-07-26 16:15:12 -0700 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | java_library_host { |
Colin Cross | 8417233 | 2021-09-14 16:41:33 -0700 | [diff] [blame] | 36 | name: "perfetto_metrics-full", |
| 37 | proto: { |
| 38 | type: "full", |
| 39 | }, |
| 40 | srcs: [ |
| 41 | "protos/perfetto/metrics/perfetto_merged_metrics.proto", |
| 42 | ], |
Sorin Basca | fdf4fb2 | 2023-02-04 15:52:44 +0000 | [diff] [blame] | 43 | // b/267831518: Pin tradefed and dependencies to Java 11. |
| 44 | java_version: "11", |
Lalit Maganti | aa035b2 | 2019-12-20 16:13:09 +0000 | [diff] [blame] | 45 | } |
| 46 | |
Primiano Tucci | 0b651b8 | 2019-06-03 17:16:23 +0100 | [diff] [blame] | 47 | // This sample target shows how to use the perfetto client API from within the |
| 48 | // Android tree. |
| 49 | cc_binary { |
Colin Cross | 8417233 | 2021-09-14 16:41:33 -0700 | [diff] [blame] | 50 | 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 Tucci | 0b651b8 | 2019-06-03 17:16:23 +0100 | [diff] [blame] | 69 | } |
Hector Dearman | 92d7d11 | 2019-12-05 15:19:57 +0000 | [diff] [blame] | 70 | |
| 71 | cc_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 | |
| 88 | genrule { |
| 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 | |
| 97 | genrule { |
| 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 Mayer | 1584c26 | 2021-03-05 13:11:22 +0000 | [diff] [blame] | 105 | |
Kalesh Singh | 8c1eb4b | 2021-03-30 11:59:09 -0400 | [diff] [blame] | 106 | sh_binary { |
| 107 | name: "mm_events", |
| 108 | src: "tools/mm_events", |
| 109 | } |
| 110 | |
Florian Mayer | 1584c26 | 2021-03-05 13:11:22 +0000 | [diff] [blame] | 111 | package { |
| 112 | default_applicable_licenses: ["external_perfetto_license"], |
| 113 | } |
| 114 | |
Paul Thomson | 109ce87 | 2021-04-07 11:41:06 +0100 | [diff] [blame] | 115 | python_library { |
| 116 | name: "perfetto-trace-processor-python", |
| 117 | srcs: [ |
| 118 | ":perfetto-trace-processor-python-srcs", |
Tomas Urbonaitis | 6373547 | 2022-08-11 15:18:06 +0200 | [diff] [blame] | 119 | ":perfetto-trace-uri-resolver-python-srcs", |
Paul Thomson | 109ce87 | 2021-04-07 11:41:06 +0100 | [diff] [blame] | 120 | ], |
| 121 | data: [ |
| 122 | ":perfetto-trace-processor-python-data", |
| 123 | ], |
Paul Thomson | 109ce87 | 2021-04-07 11:41:06 +0100 | [diff] [blame] | 124 | libs: [ |
| 125 | "libprotobuf-python", |
| 126 | ], |
| 127 | host_supported: true, |
| 128 | } |
| 129 | |
| 130 | filegroup { |
Tomas Urbonaitis | 6373547 | 2022-08-11 15:18:06 +0200 | [diff] [blame] | 131 | name: "perfetto-trace-uri-resolver-python-srcs", |
| 132 | srcs: ["python/perfetto/trace_uri_resolver/*.py"], |
| 133 | path: "python", |
| 134 | } |
| 135 | |
| 136 | filegroup { |
Paul Thomson | 109ce87 | 2021-04-07 11:41:06 +0100 | [diff] [blame] | 137 | name: "perfetto-trace-processor-python-srcs", |
Lalit Maganti | 4c76b4d | 2022-01-11 15:37:41 +0000 | [diff] [blame] | 138 | srcs: ["python/perfetto/trace_processor/*.py"], |
| 139 | path: "python", |
Paul Thomson | 109ce87 | 2021-04-07 11:41:06 +0100 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | filegroup { |
| 143 | name: "perfetto-trace-processor-python-data", |
Lalit Maganti | 4c76b4d | 2022-01-11 15:37:41 +0000 | [diff] [blame] | 144 | srcs: ["python/perfetto/trace_processor/*.descriptor*"], |
| 145 | path: "python", |
Paul Thomson | 109ce87 | 2021-04-07 11:41:06 +0100 | [diff] [blame] | 146 | } |
| 147 | |
Florian Mayer | 1584c26 | 2021-03-05 13:11:22 +0000 | [diff] [blame] | 148 | // 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 |
| 162 | license { |
| 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 Gamito | 40e6e68 | 2023-12-04 12:04:33 +0000 | [diff] [blame] | 174 | |
| 175 | // TODO(b/315118713): use list of proto file sources instead of merged proto |
| 176 | gensrcs { |
| 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 | } |