Primiano Tucci | 34bc559 | 2021-02-19 17:53:36 +0100 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 2 | # Copyright (C) 2021 The Android Open Source Project |
Lalit Maganti | 3147909 | 2019-05-30 20:29:24 +0100 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 16 | # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 17 | # DO NOT EDIT. Auto-generated by tools/gen_amalgamated_python_tools |
| 18 | # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 19 | |
Lalit Maganti | 3147909 | 2019-05-30 20:29:24 +0100 | [diff] [blame] | 20 | # This file should do the same thing when being invoked in any of these ways: |
| 21 | # ./trace_processor |
| 22 | # python trace_processor |
| 23 | # bash trace_processor |
| 24 | # cat ./trace_processor | bash |
| 25 | # cat ./trace_processor | python - |
| 26 | |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 27 | BASH_FALLBACK=""" " |
Florian Mayer | 0367ce4 | 2021-04-19 15:01:32 +0100 | [diff] [blame] | 28 | exec python3 - "$@" <<'#'EOF |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 29 | #""" # yapf: disable |
Lalit Maganti | 3147909 | 2019-05-30 20:29:24 +0100 | [diff] [blame] | 30 | |
Lalit Maganti | 3147909 | 2019-05-30 20:29:24 +0100 | [diff] [blame] | 31 | |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 32 | # ----- Amalgamator: begin of python/perfetto/prebuilts/manifests/trace_processor_shell.py |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 33 | # This file has been generated by: /usr/local/google/home/lalitm/perfetto/tools/roll-prebuilts 768b3f226580167fd3ca2d07774033648ebacd2e |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 34 | TRACE_PROCESSOR_SHELL_MANIFEST = [{ |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 35 | 'arch': |
| 36 | 'mac-amd64', |
| 37 | 'file_name': |
| 38 | 'trace_processor_shell', |
| 39 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 40 | 8385216, |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 41 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 42 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/mac-amd64/trace_processor_shell', |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 43 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 44 | '47d64e6b1f0213d28e06905cde2da24cef4a86563f1a126ddfb1e863ad0e5a31', |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 45 | 'platform': |
| 46 | 'darwin', |
| 47 | 'machine': ['x86_64'] |
| 48 | }, { |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 49 | 'arch': |
Primiano Tucci | 3304084 | 2022-04-04 22:18:08 +0100 | [diff] [blame] | 50 | 'mac-arm64', |
| 51 | 'file_name': |
| 52 | 'trace_processor_shell', |
| 53 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 54 | 7137720, |
Primiano Tucci | 3304084 | 2022-04-04 22:18:08 +0100 | [diff] [blame] | 55 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 56 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/mac-arm64/trace_processor_shell', |
Primiano Tucci | 3304084 | 2022-04-04 22:18:08 +0100 | [diff] [blame] | 57 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 58 | '1ebf66c3c51c00a566c4ac44fac084a29a4ff08c212ea34626eac22367df10f8', |
Primiano Tucci | 3304084 | 2022-04-04 22:18:08 +0100 | [diff] [blame] | 59 | 'platform': |
| 60 | 'darwin', |
| 61 | 'machine': ['arm64'] |
| 62 | }, { |
Primiano Tucci | 3304084 | 2022-04-04 22:18:08 +0100 | [diff] [blame] | 63 | 'arch': |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 64 | 'linux-amd64', |
| 65 | 'file_name': |
| 66 | 'trace_processor_shell', |
| 67 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 68 | 9319568, |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 69 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 70 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/linux-amd64/trace_processor_shell', |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 71 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 72 | '0182f6433d98226772a4896d23772256e83466297766dce1c9fb4652b987133e', |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 73 | 'platform': |
| 74 | 'linux', |
| 75 | 'machine': ['x86_64'] |
| 76 | }, { |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 77 | 'arch': |
| 78 | 'linux-arm', |
| 79 | 'file_name': |
| 80 | 'trace_processor_shell', |
| 81 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 82 | 7061684, |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 83 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 84 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/linux-arm/trace_processor_shell', |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 85 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 86 | '662989c2bf11f326303050503c0270d27496d9decbbff812d7142a2832bcbc5f', |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 87 | 'platform': |
| 88 | 'linux', |
| 89 | 'machine': ['armv6l', 'armv7l', 'armv8l'] |
| 90 | }, { |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 91 | 'arch': |
| 92 | 'linux-arm64', |
| 93 | 'file_name': |
| 94 | 'trace_processor_shell', |
| 95 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 96 | 8436528, |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 97 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 98 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/linux-arm64/trace_processor_shell', |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 99 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 100 | 'b2456a97be2e3be8034ccac02fefddf878ca46ee932d5233a021986bcd120d5e', |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 101 | 'platform': |
| 102 | 'linux', |
| 103 | 'machine': ['aarch64'] |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 104 | }, { |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 105 | 'arch': |
| 106 | 'android-arm', |
| 107 | 'file_name': |
| 108 | 'trace_processor_shell', |
| 109 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 110 | 5705408, |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 111 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 112 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/android-arm/trace_processor_shell', |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 113 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 114 | 'bea2b130ba80889e38763bddaa10c940f66475abeb70ca5f3070d8e1f4f2e080' |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 115 | }, { |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 116 | 'arch': |
| 117 | 'android-arm64', |
| 118 | 'file_name': |
| 119 | 'trace_processor_shell', |
| 120 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 121 | 7332576, |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 122 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 123 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/android-arm64/trace_processor_shell', |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 124 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 125 | '16c05bed6cb5947904987388c6a7f263ee1142bd232cbf32d751f1225a4ed449' |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 126 | }, { |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 127 | 'arch': |
| 128 | 'android-x86', |
| 129 | 'file_name': |
| 130 | 'trace_processor_shell', |
| 131 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 132 | 8248980, |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 133 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 134 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/android-x86/trace_processor_shell', |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 135 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 136 | '4f71094fc24f683b2b3c77cf07bf69a37d407edf4e1fc4c1b9adc9fdb49add44' |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 137 | }, { |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 138 | 'arch': |
| 139 | 'android-x64', |
| 140 | 'file_name': |
| 141 | 'trace_processor_shell', |
| 142 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 143 | 8594208, |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 144 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 145 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/android-x64/trace_processor_shell', |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 146 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 147 | '627e6c8f97230397626ac2387e8162a20473315a181886d7ed0ab514582edd66' |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 148 | }, { |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 149 | 'arch': |
| 150 | 'windows-amd64', |
| 151 | 'file_name': |
| 152 | 'trace_processor_shell.exe', |
| 153 | 'file_size': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 154 | 8925184, |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 155 | 'url': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 156 | 'https://commondatastorage.googleapis.com/perfetto-luci-artifacts/768b3f226580167fd3ca2d07774033648ebacd2e/windows-amd64/trace_processor_shell.exe', |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 157 | 'sha256': |
Lalit Maganti | bd8a997 | 2022-09-22 14:06:42 +0100 | [diff] [blame] | 158 | '52eb5db1e9d8784639c01d97d6078ba87f0af94030588a15e8685744d17b30cf', |
Lalit Maganti | 9d03502 | 2022-06-13 17:40:31 +0100 | [diff] [blame] | 159 | 'platform': |
| 160 | 'win32', |
| 161 | 'machine': ['amd64'] |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 162 | }] |
Matthew Clarkson | 63028d6 | 2019-10-10 15:48:23 +0100 | [diff] [blame] | 163 | |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 164 | # ----- Amalgamator: end of python/perfetto/prebuilts/manifests/trace_processor_shell.py |
Lalit Maganti | 3147909 | 2019-05-30 20:29:24 +0100 | [diff] [blame] | 165 | |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 166 | # ----- Amalgamator: begin of python/perfetto/prebuilts/perfetto_prebuilts.py |
| 167 | # Copyright (C) 2021 The Android Open Source Project |
| 168 | # |
| 169 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 170 | # you may not use this file except in compliance with the License. |
| 171 | # You may obtain a copy of the License at |
| 172 | # |
| 173 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 174 | # |
| 175 | # Unless required by applicable law or agreed to in writing, software |
| 176 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 177 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 178 | # See the License for the specific language governing permissions and |
| 179 | # limitations under the License. |
| 180 | """ |
| 181 | Functions to fetch pre-pinned Perfetto prebuilts. |
| 182 | |
| 183 | This function is used in different places: |
| 184 | - Into the //tools/{trace_processor, traceconv} scripts, which are just plain |
| 185 | wrappers around executables. |
| 186 | - Into the //tools/{heap_profiler, record_android_trace} scripts, which contain |
| 187 | some other hand-written python code. |
| 188 | |
| 189 | The manifest argument looks as follows: |
| 190 | TRACECONV_MANIFEST = [ |
| 191 | { |
| 192 | 'arch': 'mac-amd64', |
| 193 | 'file_name': 'traceconv', |
| 194 | 'file_size': 7087080, |
| 195 | 'url': https://commondatastorage.googleapis.com/.../trace_to_text', |
| 196 | 'sha256': 7d957c005b0dc130f5bd855d6cec27e060d38841b320d04840afc569f9087490', |
| 197 | 'platform': 'darwin', |
| 198 | 'machine': 'x86_64' |
| 199 | }, |
| 200 | ... |
| 201 | ] |
| 202 | |
| 203 | The intended usage is: |
| 204 | |
| 205 | from perfetto.prebuilts.manifests.traceconv import TRACECONV_MANIFEST |
| 206 | bin_path = get_perfetto_prebuilt(TRACECONV_MANIFEST) |
| 207 | subprocess.call(bin_path, ...) |
| 208 | """ |
| 209 | |
| 210 | import hashlib |
| 211 | import os |
| 212 | import platform |
| 213 | import subprocess |
| 214 | import sys |
| 215 | |
| 216 | |
| 217 | def download_or_get_cached(file_name, url, sha256): |
| 218 | """ Downloads a prebuilt or returns a cached version |
| 219 | |
| 220 | The first time this is invoked, it downloads the |url| and caches it into |
| 221 | ~/.perfetto/prebuilts/$tool_name. On subsequent invocations it just runs the |
| 222 | cached version. |
| 223 | """ |
| 224 | dir = os.path.join( |
| 225 | os.path.expanduser('~'), '.local', 'share', 'perfetto', 'prebuilts') |
| 226 | os.makedirs(dir, exist_ok=True) |
| 227 | bin_path = os.path.join(dir, file_name) |
| 228 | sha256_path = os.path.join(dir, file_name + '.sha256') |
| 229 | needs_download = True |
| 230 | |
| 231 | # Avoid recomputing the SHA-256 on each invocation. The SHA-256 of the last |
| 232 | # download is cached into file_name.sha256, just check if that matches. |
| 233 | if os.path.exists(bin_path) and os.path.exists(sha256_path): |
| 234 | with open(sha256_path, 'rb') as f: |
| 235 | digest = f.read().decode() |
| 236 | if digest == sha256: |
| 237 | needs_download = False |
| 238 | |
| 239 | if needs_download: |
| 240 | # Either the filed doesn't exist or the SHA256 doesn't match. |
| 241 | tmp_path = bin_path + '.tmp' |
| 242 | print('Downloading ' + url) |
| 243 | subprocess.check_call(['curl', '-f', '-L', '-#', '-o', tmp_path, url]) |
| 244 | with open(tmp_path, 'rb') as fd: |
| 245 | actual_sha256 = hashlib.sha256(fd.read()).hexdigest() |
| 246 | if actual_sha256 != sha256: |
| 247 | raise Exception('Checksum mismatch for %s (actual: %s, expected: %s)' % |
| 248 | (url, actual_sha256, sha256)) |
| 249 | os.chmod(tmp_path, 0o755) |
| 250 | os.rename(tmp_path, bin_path) |
| 251 | with open(sha256_path, 'w') as f: |
| 252 | f.write(sha256) |
| 253 | return bin_path |
| 254 | |
| 255 | |
| 256 | def get_perfetto_prebuilt(manifest, soft_fail=False, arch=None): |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 257 | """ Downloads the prebuilt, if necessary, and returns its path on disk. """ |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 258 | plat = sys.platform.lower() |
| 259 | machine = platform.machine().lower() |
| 260 | manifest_entry = None |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 261 | for entry in manifest: |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 262 | # If the caller overrides the arch, just match that (for Android prebuilts). |
Lalit Maganti | 3142363 | 2022-06-30 17:21:22 +0100 | [diff] [blame] | 263 | if arch: |
| 264 | if entry.get('arch') == arch: |
| 265 | manifest_entry = entry |
| 266 | break |
| 267 | continue |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 268 | # Otherwise guess the local machine arch. |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 269 | if entry.get('platform') == plat and machine in entry.get('machine', []): |
Primiano Tucci | d3e40bd | 2021-08-03 10:52:39 +0100 | [diff] [blame] | 270 | manifest_entry = entry |
| 271 | break |
| 272 | if manifest_entry is None: |
| 273 | if soft_fail: |
| 274 | return None |
| 275 | raise Exception( |
| 276 | ('No prebuilts available for %s-%s\n' % (plat, machine)) + |
| 277 | 'See https://perfetto.dev/docs/contributing/build-instructions') |
| 278 | |
| 279 | return download_or_get_cached( |
| 280 | file_name=manifest_entry['file_name'], |
| 281 | url=manifest_entry['url'], |
| 282 | sha256=manifest_entry['sha256']) |
Lalit Maganti | 2783248 | 2020-05-18 12:10:50 +0100 | [diff] [blame] | 283 | |
| 284 | |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 285 | def run_perfetto_prebuilt(manifest): |
| 286 | bin_path = get_perfetto_prebuilt(manifest) |
| 287 | if sys.platform.lower() == 'win32': |
| 288 | sys.exit(subprocess.check_call([bin_path, *sys.argv[1:]])) |
| 289 | os.execv(bin_path, [bin_path] + sys.argv[1:]) |
| 290 | |
| 291 | # ----- Amalgamator: end of python/perfetto/prebuilts/perfetto_prebuilts.py |
Matthew Clarkson | 63028d6 | 2019-10-10 15:48:23 +0100 | [diff] [blame] | 292 | |
Lalit Maganti | 3147909 | 2019-05-30 20:29:24 +0100 | [diff] [blame] | 293 | if __name__ == '__main__': |
Primiano Tucci | 11d94e1 | 2022-08-02 17:44:33 +0100 | [diff] [blame] | 294 | run_perfetto_prebuilt(TRACE_PROCESSOR_SHELL_MANIFEST) |
Lalit Maganti | 3147909 | 2019-05-30 20:29:24 +0100 | [diff] [blame] | 295 | |
Lalit Maganti | 3147909 | 2019-05-30 20:29:24 +0100 | [diff] [blame] | 296 | #EOF |