diff --git a/cmds/statsd/Android.bp b/cmds/statsd/Android.bp index 2f0dc3cb1e981..6df0a8e14f6ac 100644 --- a/cmds/statsd/Android.bp +++ b/cmds/statsd/Android.bp @@ -71,7 +71,6 @@ cc_defaults { "src/config/ConfigManager.cpp", "src/external/GpuStatsPuller.cpp", "src/external/Perfetto.cpp", - "src/external/Perfprofd.cpp", "src/external/StatsPuller.cpp", "src/external/StatsCallbackPuller.cpp", "src/external/StatsCompanionServicePuller.cpp", @@ -109,8 +108,6 @@ cc_defaults { "src/socket/StatsSocketListener.cpp", "src/shell/ShellSubscriber.cpp", "src/shell/shell_config.proto", - - ":perfprofd_aidl", ], local_include_dirs: [ diff --git a/cmds/statsd/src/anomaly/subscriber_util.cpp b/cmds/statsd/src/anomaly/subscriber_util.cpp index 548a6869436db..e09d5751d3238 100644 --- a/cmds/statsd/src/anomaly/subscriber_util.cpp +++ b/cmds/statsd/src/anomaly/subscriber_util.cpp @@ -22,7 +22,6 @@ #include #include "external/Perfetto.h" -#include "external/Perfprofd.h" #include "subscriber/IncidentdReporter.h" #include "subscriber/SubscriberReporter.h" @@ -64,12 +63,6 @@ void triggerSubscribers(int64_t ruleId, int64_t metricId, const MetricDimensionK SubscriberReporter::getInstance().alertBroadcastSubscriber(configKey, subscription, dimensionKey); break; - case Subscription::SubscriberInformationCase::kPerfprofdDetails: - if (!CollectPerfprofdTraceAndUploadToDropbox(subscription.perfprofd_details(), - ruleId, configKey)) { - ALOGW("Failed to generate perfprofd traces."); - } - break; default: break; } diff --git a/cmds/statsd/src/external/Perfprofd.cpp b/cmds/statsd/src/external/Perfprofd.cpp deleted file mode 100644 index 1678f104a07a2..0000000000000 --- a/cmds/statsd/src/external/Perfprofd.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2018 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 "Perfprofd.h" - -#define DEBUG false // STOPSHIP if true -#include "config/ConfigKey.h" -#include "Log.h" - -#include -#include -#include -#include -#include - -#include - -#include - -#include "frameworks/base/cmds/statsd/src/statsd_config.pb.h" // Alert - -#include "android/os/IPerfProfd.h" - -namespace android { -namespace os { -namespace statsd { - -bool CollectPerfprofdTraceAndUploadToDropbox(const PerfprofdDetails& config, - int64_t alert_id, - const ConfigKey& configKey) { - VLOG("Starting trace collection through perfprofd"); - - if (!config.has_perfprofd_config()) { - ALOGE("The perfprofd trace config is empty, aborting"); - return false; - } - - sp service = interface_cast( - defaultServiceManager()->getService(android::String16("perfprofd"))); - if (service == NULL) { - ALOGE("Could not find perfprofd service"); - return false; - } - - auto* data = reinterpret_cast(config.perfprofd_config().data()); - std::vector proto_serialized(data, data + config.perfprofd_config().size()); - - // TODO: alert-id etc? - - binder::Status status = service->startProfilingProtobuf(proto_serialized); - if (status.isOk()) { - return true; - } - - ALOGE("Error starting perfprofd profiling: %s", status.toString8().c_str()); - return false; -} - -} // namespace statsd -} // namespace os -} // namespace android diff --git a/cmds/statsd/src/external/Perfprofd.h b/cmds/statsd/src/external/Perfprofd.h deleted file mode 100644 index b93fdf8e1cb27..0000000000000 --- a/cmds/statsd/src/external/Perfprofd.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2018 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 - -namespace android { -namespace os { -namespace statsd { - -class ConfigKey; -class PerfprofdDetails; // Declared in statsd_config.pb.h - -// Starts the collection of a Perfprofd trace with the given |config|. -// The trace is uploaded to Dropbox by the perfprofd service once done. -// This method returns immediately after passing the config and does NOT wait -// for the full duration of the trace. -bool CollectPerfprofdTraceAndUploadToDropbox(const PerfprofdDetails& config, - int64_t alert_id, - const ConfigKey& configKey); - -} // namespace statsd -} // namespace os -} // namespace android diff --git a/cmds/statsd/src/statsd_config.proto b/cmds/statsd/src/statsd_config.proto index a2fd9d42f488f..79c06b98a82db 100644 --- a/cmds/statsd/src/statsd_config.proto +++ b/cmds/statsd/src/statsd_config.proto @@ -343,15 +343,6 @@ message PerfettoDetails { optional bytes trace_config = 1; } -message PerfprofdDetails { - // The |perfprofd_config| field is a proto-encoded message of type - // android.perfprofd.ProfilingConfig defined in - // //system/extras/perfprofd/. On device, statsd doesn't need to - // deserialize the message as it's just passed binary-encoded to - // the perfprofd service. - optional bytes perfprofd_config = 1; -} - message BroadcastSubscriberDetails { optional int64 subscriber_id = 1; repeated string cookie = 2; @@ -373,10 +364,12 @@ message Subscription { IncidentdDetails incidentd_details = 4; PerfettoDetails perfetto_details = 5; BroadcastSubscriberDetails broadcast_subscriber_details = 6; - PerfprofdDetails perfprofd_details = 8; } optional float probability_of_informing = 7 [default = 1.1]; + + // This was used for perfprofd historically. + reserved 8; } enum ActivationType {