diff options
author | Daniele Di Proietto <ddiproietto@google.com> | 2022-09-16 16:03:55 +0000 |
---|---|---|
committer | Daniele Di Proietto <ddiproietto@google.com> | 2023-02-07 18:29:41 +0000 |
commit | 277bdf579c5ffa423aa37d4d8999e9ab0f4319e9 (patch) | |
tree | 86fabb334de5f4fabcfb2e4d86389e5089758d8d /atrace | |
parent | 734de86ce4b84746f7a7bc83ce1c0b62e605d204 (diff) | |
download | pixel-277bdf579c5ffa423aa37d4d8999e9ab0f4319e9.tar.gz |
Remove atrace vendor HAL implementation
It has been replaced with the atrace vendor file in a previous commit.
Bug: 204935495
Change-Id: Iecd95498eb301f2c62a318a450f60b64e045e4c1
Diffstat (limited to 'atrace')
-rw-r--r-- | atrace/Android.bp | 20 | ||||
-rw-r--r-- | atrace/AtraceDevice.cpp | 157 | ||||
-rw-r--r-- | atrace/AtraceDevice.h | 53 | ||||
-rw-r--r-- | atrace/android.hardware.atrace@1.0-service.pixel.rc | 53 | ||||
-rw-r--r-- | atrace/android.hardware.atrace@1.0-service.pixel.xml | 11 | ||||
-rw-r--r-- | atrace/service.cpp | 45 |
6 files changed, 0 insertions, 339 deletions
diff --git a/atrace/Android.bp b/atrace/Android.bp index d194c1c6..d3a1f402 100644 --- a/atrace/Android.bp +++ b/atrace/Android.bp @@ -17,26 +17,6 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -cc_binary { - name: "android.hardware.atrace@1.0-service.pixel", - defaults: ["hidl_defaults"], - relative_install_path: "hw", - vendor: true, - init_rc: ["android.hardware.atrace@1.0-service.pixel.rc"], - vintf_fragments: ["android.hardware.atrace@1.0-service.pixel.xml"], - srcs: [ - "AtraceDevice.cpp", - "service.cpp", - ], - shared_libs: [ - "liblog", - "libbase", - "libutils", - "libhidlbase", - "android.hardware.atrace@1.0", - ], -} - genrule { name: "atrace_categories.rc.pixel", tool_files: ["generate_rc.py"], diff --git a/atrace/AtraceDevice.cpp b/atrace/AtraceDevice.cpp deleted file mode 100644 index 0d66270d..00000000 --- a/atrace/AtraceDevice.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2019 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. - */ - -#include <android-base/file.h> -#include <android-base/logging.h> -#include <android-base/stringprintf.h> - -#include "AtraceDevice.h" - -namespace android { -namespace hardware { -namespace atrace { -namespace V1_0 { -namespace implementation { - -using ::android::hardware::atrace::V1_0::Status; -using ::android::hardware::atrace::V1_0::TracingCategory; - -struct TracingConfig { - std::string description; - // path and if error on failure - std::vector<std::pair<std::string, bool>> paths; -}; - -// This is a map stores categories and their tracefs event name with required flags -const std::map<std::string, TracingConfig> kTracingMap = { - { - "gfx", - {"Graphics", - {{"mdss", false}, - {"sde", false}, - {"dpu", false}, - {"g2d", false}, - {"mali", false}}}, - }, - { - "memory", - {"Memory", - {{"fastrpc/fastrpc_dma_stat", false}, - {"dmabuf_heap", false}, - {"cma/cma_alloc_start", false}, - {"cma/cma_alloc_info", false}}}, - }, - { - "ion", - {"ION Allocation", {{"kmem/ion_alloc_buffer_start", false}}}, - }, - { - "sched", - {"CPU Scheduling and Trustzone", {{"scm", false}, {"systrace", false}}}, - }, - { - "freq", - {"CPU Frequency and System Clock", {{"msm_bus", false}}}, - }, - { - "thermal_tj", - {"Tj power limits and frequency", - {{"lmh/lmh_dcvs_freq", false}, - {"thermal_exynos", false}, - {"thermal_exynos_gpu", false}}}, - }, - { - "camera", - {"Camera LWIS", {{"lwis", false}}}, - }, -}; - -// Methods from ::android::hardware::atrace::V1_0::IAtraceDevice follow. -Return<void> AtraceDevice::listCategories(listCategories_cb _hidl_cb) { - hidl_vec<TracingCategory> categories; - categories.resize(kTracingMap.size()); - std::size_t i = 0; - for (auto &c : kTracingMap) { - categories[i].name = c.first; - categories[i].description = c.second.description; - i++; - } - _hidl_cb(categories); - return Void(); -} - -AtraceDevice::AtraceDevice() { - struct stat st; - - mTracefsEventRoot = "/sys/kernel/tracing/events/"; - if (stat(mTracefsEventRoot.c_str(), &st) != 0) { - mTracefsEventRoot = "/sys/kernel/debug/tracing/events/"; - CHECK(stat(mTracefsEventRoot.c_str(), &st) == 0) << "tracefs must be mounted at either" - "/sys/kernel/tracing or " - "/sys/kernel/debug/tracing"; - } -} - -Return<::android::hardware::atrace::V1_0::Status> AtraceDevice::enableCategories( - const hidl_vec<hidl_string> &categories) { - if (!categories.size()) { - return Status::ERROR_INVALID_ARGUMENT; - } - - for (auto &c : categories) { - if (kTracingMap.count(c)) { - for (auto &p : kTracingMap.at(c).paths) { - std::string tracefs_event_enable_path = android::base::StringPrintf( - "%s%s/enable", mTracefsEventRoot.c_str(), p.first.c_str()); - if (!android::base::WriteStringToFile("1", tracefs_event_enable_path)) { - LOG(ERROR) << "Failed to enable tracing on: " << tracefs_event_enable_path; - if (p.second) { - // disable before return - disableAllCategories(); - return Status::ERROR_TRACING_POINT; - } - } - } - } else { - return Status::ERROR_INVALID_ARGUMENT; - } - } - return Status::SUCCESS; -} - -Return<::android::hardware::atrace::V1_0::Status> AtraceDevice::disableAllCategories() { - auto ret = Status::SUCCESS; - - for (auto &c : kTracingMap) { - for (auto &p : c.second.paths) { - std::string tracefs_event_enable_path = android::base::StringPrintf( - "%s%s/enable", mTracefsEventRoot.c_str(), p.first.c_str()); - if (!android::base::WriteStringToFile("0", tracefs_event_enable_path)) { - LOG(ERROR) << "Failed to disable tracing on: " << tracefs_event_enable_path; - if (p.second) { - ret = Status::ERROR_TRACING_POINT; - } - } - } - } - return ret; -} - -} // namespace implementation -} // namespace V1_0 -} // namespace atrace -} // namespace hardware -} // namespace android diff --git a/atrace/AtraceDevice.h b/atrace/AtraceDevice.h deleted file mode 100644 index 2863cd3b..00000000 --- a/atrace/AtraceDevice.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2019 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. - */ - -#pragma once - -#include <android/hardware/atrace/1.0/IAtraceDevice.h> -#include <hidl/Status.h> - -namespace android { -namespace hardware { -namespace atrace { -namespace V1_0 { -namespace implementation { - -using ::android::sp; -using ::android::hardware::hidl_array; -using ::android::hardware::hidl_memory; -using ::android::hardware::hidl_string; -using ::android::hardware::hidl_vec; -using ::android::hardware::Return; -using ::android::hardware::Void; - -struct AtraceDevice : public IAtraceDevice { - AtraceDevice(); - // Methods from ::android::hardware::atrace::V1_0::IAtraceDevice follow. - Return<void> listCategories(listCategories_cb _hidl_cb) override; - Return<::android::hardware::atrace::V1_0::Status> enableCategories( - const hidl_vec<hidl_string> &categories) override; - Return<::android::hardware::atrace::V1_0::Status> disableAllCategories() override; - - private: - std::string mTracefsEventRoot; - // Methods from ::android::hidl::base::V1_0::IBase follow. -}; - -} // namespace implementation -} // namespace V1_0 -} // namespace atrace -} // namespace hardware -} // namespace android diff --git a/atrace/android.hardware.atrace@1.0-service.pixel.rc b/atrace/android.hardware.atrace@1.0-service.pixel.rc deleted file mode 100644 index 205c90c9..00000000 --- a/atrace/android.hardware.atrace@1.0-service.pixel.rc +++ /dev/null @@ -1,53 +0,0 @@ -on late-init - # vendor graphics trace points - chmod 0666 /sys/kernel/debug/tracing/events/sde/enable - chmod 0666 /sys/kernel/tracing/events/sde/enable - chmod 0666 /sys/kernel/debug/tracing/events/mdss/enable - chmod 0666 /sys/kernel/tracing/events/mdss/enable - chmod 0666 /sys/kernel/debug/tracing/events/dpu/enable - chmod 0666 /sys/kernel/tracing/events/dpu/enable - chmod 0666 /sys/kernel/debug/tracing/events/g2d/enable - chmod 0666 /sys/kernel/tracing/events/g2d/enable - chmod 0666 /sys/kernel/debug/tracing/events/mali/enable - chmod 0666 /sys/kernel/tracing/events/mali/enable - - # Camera LWIS trace points - chmod 0666 /sys/kernel/debug/tracing/events/lwis/enable - chmod 0666 /sys/kernel/tracing/events/lwis/enable - - # ion allocation trace point - chmod 0666 /sys/kernel/debug/tracing/events/kmem/ion_alloc_buffer_start/enable - chmod 0666 /sys/kernel/tracing/events/kmem/ion_alloc_buffer_start/enable - # scm trace point - chmod 0666 /sys/kernel/debug/tracing/events/scm/enable - chmod 0666 /sys/kernel/tracing/events/scm/enable - # system bus clk trace point - chmod 0666 /sys/kernel/debug/tracing/events/msm_bus/enable - chmod 0666 /sys/kernel/tracing/events/msm_bus/enable - # legacy systrace point - chmod 0666 /sys/kernel/debug/tracing/events/systrace/enable - chmod 0666 /sys/kernel/tracing/events/systrace/enable - # qct hw lmh-dcvs - chmod 0666 /sys/kernel/debug/tracing/events/lmh/lmh_dcvs_freq/enable - chmod 0666 /sys/kernel/tracing/events/lmh/lmh_dcvs_freq/enable - # qct fastrpc dma buffers - chmod 0666 /sys/kernel/debug/tracing/events/fastrpc/fastrpc_dma_stat/enable - chmod 0666 /sys/kernel/tracing/events/fastrpc/fastrpc_dma_stat/enable - # dmabuf heap stats - chmod 0666 /sys/kernel/tracing/events/dmabuf_heap/enable - # Tj pid control loop trace points - chmod 0666 /sys/kernel/debug/tracing/events/thermal_exynos/enable - chmod 0666 /sys/kernel/tracing/events/thermal_exynos/enable - chmod 0666 /sys/kernel/debug/tracing/events/thermal_exynos_gpu/enable - chmod 0666 /sys/kernel/tracing/events/thermal_exynos_gpu/enable - # memory trace points - chmod 0666 /sys/kernel/tracing/events/cma/cma_alloc_start/enable - chmod 0666 /sys/kernel/tracing/events/cma/cma_alloc_info/enable - -service vendor.atrace-hal-1-0 /vendor/bin/hw/android.hardware.atrace@1.0-service.pixel - interface android.hardware.atrace@1.0::IAtraceDevice default - class early_hal - user system - group system readtracefs - oneshot - disabled diff --git a/atrace/android.hardware.atrace@1.0-service.pixel.xml b/atrace/android.hardware.atrace@1.0-service.pixel.xml deleted file mode 100644 index fd3631ca..00000000 --- a/atrace/android.hardware.atrace@1.0-service.pixel.xml +++ /dev/null @@ -1,11 +0,0 @@ -<manifest version="1.0" type="device"> - <hal format="hidl"> - <name>android.hardware.atrace</name> - <transport>hwbinder</transport> - <version>1.0</version> - <interface> - <name>IAtraceDevice</name> - <instance>default</instance> - </interface> - </hal> -</manifest> diff --git a/atrace/service.cpp b/atrace/service.cpp deleted file mode 100644 index f510325b..00000000 --- a/atrace/service.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2019 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. - */ - -#define LOG_TAG "android.hardware.atrace@1.0-service.pixel" - -#include <hidl/HidlLazyUtils.h> -#include <hidl/HidlSupport.h> -#include <hidl/HidlTransportSupport.h> - -#include "AtraceDevice.h" - -using ::android::OK; -using ::android::sp; -using ::android::hardware::configureRpcThreadpool; -using ::android::hardware::joinRpcThreadpool; -using ::android::hardware::LazyServiceRegistrar; -using ::android::hardware::atrace::V1_0::IAtraceDevice; -using ::android::hardware::atrace::V1_0::implementation::AtraceDevice; - -int main(int /* argc */, char * /* argv */ []) { - sp<IAtraceDevice> atrace = new AtraceDevice; - configureRpcThreadpool(1, true /* will join */); - auto serviceRegistrar = LazyServiceRegistrar::getInstance(); - if (serviceRegistrar.registerService(atrace) != OK) { - ALOGE("Could not register service."); - return 1; - } - joinRpcThreadpool(); - - ALOGE("Service exited!"); - return 1; -} |