summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--atrace/AtraceDevice.cpp4
-rw-r--r--atrace/android.hardware.atrace@1.0-service.pixel.rc2
-rw-r--r--atrace/service.cpp5
3 files changed, 8 insertions, 3 deletions
diff --git a/atrace/AtraceDevice.cpp b/atrace/AtraceDevice.cpp
index 26e56966..c673275b 100644
--- a/atrace/AtraceDevice.cpp
+++ b/atrace/AtraceDevice.cpp
@@ -84,7 +84,7 @@ Return<::android::hardware::atrace::V1_0::Status> AtraceDevice::enableCategories
if (kTracingMap.count(c)) {
for (auto &p : kTracingMap.at(c).paths) {
if (!android::base::WriteStringToFile("1", p.first)) {
- LOG(ERROR) << "Failed to disable tracing on: " << p.first;
+ LOG(ERROR) << "Failed to enable tracing on: " << p.first;
if (p.second) {
// disable before return
disableAllCategories();
@@ -104,7 +104,7 @@ Return<::android::hardware::atrace::V1_0::Status> AtraceDevice::disableAllCatego
for (auto &c : kTracingMap) {
for (auto &p : c.second.paths) {
if (!android::base::WriteStringToFile("0", p.first)) {
- LOG(ERROR) << "Failed to enable tracing on: " << p.first;
+ LOG(ERROR) << "Failed to disable tracing on: " << p.first;
if (p.second) {
ret = Status::ERROR_TRACING_POINT;
}
diff --git a/atrace/android.hardware.atrace@1.0-service.pixel.rc b/atrace/android.hardware.atrace@1.0-service.pixel.rc
index ef50fd0a..b26296d5 100644
--- a/atrace/android.hardware.atrace@1.0-service.pixel.rc
+++ b/atrace/android.hardware.atrace@1.0-service.pixel.rc
@@ -17,3 +17,5 @@ service vendor.atrace-hal-1-0 /vendor/bin/hw/android.hardware.atrace@1.0-service
class early_hal
user system
group system
+ oneshot
+ disabled
diff --git a/atrace/service.cpp b/atrace/service.cpp
index 423c39d0..3164aa26 100644
--- a/atrace/service.cpp
+++ b/atrace/service.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "android.hardware.atrace@1.0-service.pixel"
+#include <hidl/HidlLazyUtils.h>
#include <hidl/HidlSupport.h>
#include <hidl/HidlTransportSupport.h>
@@ -25,13 +26,15 @@ 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 */);
- if (atrace->registerAsService() != OK) {
+ auto serviceRegistrar = std::make_shared<LazyServiceRegistrar>();
+ if (serviceRegistrar->registerService(atrace) != OK) {
ALOGE("Could not register service.");
return 1;
}