| // |
| // Copyright (C) 2022 The Android Open Source Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| // |
| |
| package { |
| // See: http://go/android-license-faq |
| // A large-scale-change added 'default_applicable_licenses' to import |
| // all of the 'license_kinds' from "system_extras_simpleperf_license" |
| // to get the below license kinds: |
| // SPDX-license-identifier-Apache-2.0 |
| default_applicable_licenses: ["system_extras_simpleperf_license"], |
| } |
| |
| cc_genrule { |
| name: "simpleperf_linux_x86_64_binutils", |
| tools: [ |
| "llvm-objdump", |
| "llvm-readobj", |
| "llvm-symbolizer", |
| ], |
| out: [ |
| "bin/linux/x86_64/llvm-objdump", |
| "bin/linux/x86_64/llvm-readelf", |
| "bin/linux/x86_64/llvm-symbolizer", |
| ], |
| cmd: "mkdir -p $(genDir)/bin/linux/x86_64 && " + |
| "cp $(location llvm-objdump) $(genDir)/bin/linux/x86_64 && " + |
| "cp $(location llvm-readobj) $(genDir)/bin/linux/x86_64/llvm-readelf && " + |
| "cp $(location llvm-symbolizer) $(genDir)/bin/linux/x86_64", |
| |
| host_supported: true, |
| target: { |
| darwin: { |
| enabled: false, |
| }, |
| windows: { |
| enabled: false, |
| }, |
| }, |
| } |
| |
| python_library_host { |
| name: "simpleperf_report_lib", |
| srcs: [ |
| "etm_types.py", |
| "report_sample_pb2.py", |
| "simpleperf_report_lib.py", |
| "simpleperf_utils.py", |
| ], |
| data: [ |
| "bin/darwin/x86_64/libsimpleperf_report.dylib", |
| "bin/linux/x86_64/libsimpleperf_report.so", |
| "bin/windows/**/*.dll", |
| ], |
| target: { |
| linux: { |
| data: [ |
| ":simpleperf_linux_x86_64_binutils", |
| ], |
| }, |
| }, |
| } |
| |
| python_library_host { |
| name: "profile_py_pb2", |
| srcs: [ |
| "profile_pb2.py", |
| ], |
| libs: [ |
| "libprotobuf-python", |
| ], |
| proto: { |
| include_dirs: ["external/protobuf/src"], |
| canonical_path_from_root: false, |
| }, |
| } |
| |
| python_binary_host { |
| name: "pprof_proto_generator", |
| srcs: [ |
| "pprof_proto_generator.py", |
| ], |
| libs: [ |
| "profile_py_pb2", |
| "simpleperf_report_lib", |
| ], |
| } |
| |
| python_binary_host { |
| name: "binary_cache_builder", |
| srcs: [ |
| "binary_cache_builder.py", |
| ], |
| libs: [ |
| "profile_py_pb2", |
| "simpleperf_report_lib", |
| ], |
| } |