1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
/*
* Copyright (C) 2016 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.
*/
syntax = "proto3";
package profiler.proto;
option java_package = "com.android.tools.profiler.proto";
option java_outer_classname = "CpuProfiler";
import "cpu_profiler_data.proto";
service CpuProfilerService {
rpc GetData(CpuDataRequest) returns (CpuDataResponse) {
}
// Starts collecting execution metrics of a running app, such as usage info
// and thread states. Does nothing if the app is already being monitored.
// TODO(b/29258733): Support configuring sampling details.
rpc StartMonitoringApp(CpuStartRequest) returns (CpuStartResponse) {
}
// Stops monitoring a running app. Does nothing if the app is not being
// monitored, or is not running.
rpc StopMonitoringApp(CpuStopRequest) returns (CpuStopResponse) {
}
}
// Requests profiler data from the app with ID being |app_id|, in the time range
// from |start_timestamp| (exclusive) to |end_timestamp| (inclusive), or
// mathematically written as in interval (start_timestamp, end_timestamp].
message CpuDataRequest {
enum SpecialValues {
// Protobuf requires the first enum value to be zero.
UNSPECIFIED = 0;
// A speical value used in |app_id| field to indicate the data of all apps
// are requested.
ANY_APP = -1;
}
int32 app_id = 1; // Use |ANY_APP| if requesting the data of any apps.
int64 start_timestamp = 2; // Use -2^63 if no data is too old to return.
int64 end_timestamp = 3; // Use 2^63 - 1 if no data is too recent to return.
}
message CpuDataResponse {
repeated CpuProfilerData data = 1;
}
message CpuStartRequest {
int32 app_id = 1;
}
message CpuStartResponse {
enum Status {
UNSPECIFICED = 0;
SUCCESS = 1;
FAILURE_APP_NOT_RUNNING = 2;
FAILURE_UNKNOWN = 3;
}
Status status = 1;
}
message CpuStopRequest {
int32 app_id = 1;
}
message CpuStopResponse {
enum Status {
UNSPECIFICED = 0;
SUCCESS = 1;
FAILURE_UNKNOWN = 2;
}
Status status = 1;
}
|